Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(876)

Side by Side Diff: third_party/WebKit/Source/web/tests/ActivityLoggerTest.cpp

Issue 1667653002: V8-binding: Use v8::Template::SetNativeDataProperty without setter for [Replaceable]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the [LenientThis] test to http/tests/. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/ScriptController.h" 5 #include "bindings/core/v8/ScriptController.h"
6 #include "bindings/core/v8/ScriptSourceCode.h" 6 #include "bindings/core/v8/ScriptSourceCode.h"
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "bindings/core/v8/V8DOMActivityLogger.h" 8 #include "bindings/core/v8/V8DOMActivityLogger.h"
9 #include "public/web/WebCache.h" 9 #include "public/web/WebCache.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void logEvent(const String& eventName, int argc, const String* argv) overrid e 44 void logEvent(const String& eventName, int argc, const String* argv) overrid e
45 { 45 {
46 String activityString = eventName; 46 String activityString = eventName;
47 for (int i = 0; i < argc; i++) { 47 for (int i = 0; i < argc; i++) {
48 activityString = activityString + " | " + argv[i]; 48 activityString = activityString + " | " + argv[i];
49 } 49 }
50 m_loggedActivities.append(activityString); 50 m_loggedActivities.append(activityString);
51 } 51 }
52 52
53 void clear() { m_loggedActivities.clear(); } 53 void clear() { m_loggedActivities.clear(); }
54 bool verifyActivities(const Vector<String>& activities) const { return m_log gedActivities == activities; } 54 bool verifyActivities(const Vector<String>& expected) const
55 {
56 EXPECT_EQ(expected.size(), m_loggedActivities.size());
57 for (size_t i = 0; i < std::min(expected.size(), m_loggedActivities.size ()); ++i) {
58 EXPECT_STREQ(expected[i].utf8().data(), m_loggedActivities[i].utf8() .data());
59 }
60 return m_loggedActivities == expected;
61 }
55 62
56 private: 63 private:
57 Vector<String> m_loggedActivities; 64 Vector<String> m_loggedActivities;
58 }; 65 };
59 66
60 class ActivityLoggerTest : public testing::Test { 67 class ActivityLoggerTest : public testing::Test {
61 protected: 68 protected:
62 ActivityLoggerTest() 69 ActivityLoggerTest()
63 { 70 {
64 m_activityLogger = new TestActivityLogger(); 71 m_activityLogger = new TestActivityLogger();
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 "blinkAddElement | script | data:text/html;charset=utf-8,D\n" 529 "blinkAddElement | script | data:text/html;charset=utf-8,D\n"
523 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" 530 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n"
524 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E" ; 531 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E" ;
525 executeScriptInMainWorld(code); 532 executeScriptInMainWorld(code);
526 ASSERT_TRUE(verifyActivities("")); 533 ASSERT_TRUE(verifyActivities(""));
527 executeScriptInIsolatedWorld(code); 534 executeScriptInIsolatedWorld(code);
528 ASSERT_TRUE(verifyActivities(expectedActivities)); 535 ASSERT_TRUE(verifyActivities(expectedActivities));
529 } 536 }
530 537
531 } // namespace blink 538 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698