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

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

Issue 2811793005: Rename LocalFrame::Script() to GetScriptController() (Closed)
Patch Set: Created 3 years, 8 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
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 "platform/wtf/Forward.h" 9 #include "platform/wtf/Forward.h"
10 #include "platform/wtf/PtrUtil.h" 10 #include "platform/wtf/PtrUtil.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 Vector<String> logged_activities_; 69 Vector<String> logged_activities_;
70 }; 70 };
71 71
72 class ActivityLoggerTest : public testing::Test { 72 class ActivityLoggerTest : public testing::Test {
73 protected: 73 protected:
74 ActivityLoggerTest() { 74 ActivityLoggerTest() {
75 activity_logger_ = new TestActivityLogger(); 75 activity_logger_ = new TestActivityLogger();
76 V8DOMActivityLogger::SetActivityLogger(kIsolatedWorldId, String(), 76 V8DOMActivityLogger::SetActivityLogger(kIsolatedWorldId, String(),
77 WTF::WrapUnique(activity_logger_)); 77 WTF::WrapUnique(activity_logger_));
78 web_view_helper_.Initialize(true); 78 web_view_helper_.Initialize(true);
79 script_controller_ = 79 script_controller_ = &web_view_helper_.WebView()
80 &web_view_helper_.WebView()->MainFrameImpl()->GetFrame()->Script(); 80 ->MainFrameImpl()
81 ->GetFrame()
82 ->GetScriptController();
81 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrame(), 83 FrameTestHelpers::LoadFrame(web_view_helper_.WebView()->MainFrame(),
82 "about:blank"); 84 "about:blank");
83 } 85 }
84 86
85 ~ActivityLoggerTest() { WebCache::Clear(); } 87 ~ActivityLoggerTest() { WebCache::Clear(); }
86 88
87 void ExecuteScriptInMainWorld(const String& script) const { 89 void ExecuteScriptInMainWorld(const String& script) const {
88 v8::HandleScope scope(v8::Isolate::GetCurrent()); 90 v8::HandleScope scope(v8::Isolate::GetCurrent());
89 script_controller_->ExecuteScriptInMainWorld(script); 91 script_controller_->ExecuteScriptInMainWorld(script);
90 PumpPendingRequestsForFrameToLoad(web_view_helper_.WebView()->MainFrame()); 92 PumpPendingRequestsForFrameToLoad(web_view_helper_.WebView()->MainFrame());
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n" 587 "blinkRequestResource | Script | data:text/html;charset=utf-8,D\n"
586 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E\n" 588 "blinkRequestResource | XMLHttpRequest | data:text/html;charset=utf-8,E\n"
587 "blinkRequestResource | Image | data:text/html;charset=utf-8,B\n"; 589 "blinkRequestResource | Image | data:text/html;charset=utf-8,B\n";
588 ExecuteScriptInMainWorld(code); 590 ExecuteScriptInMainWorld(code);
589 ASSERT_TRUE(VerifyActivities("")); 591 ASSERT_TRUE(VerifyActivities(""));
590 ExecuteScriptInIsolatedWorld(code); 592 ExecuteScriptInIsolatedWorld(code);
591 ASSERT_TRUE(VerifyActivities(expected_activities)); 593 ASSERT_TRUE(VerifyActivities(expected_activities));
592 } 594 }
593 595
594 } // namespace blink 596 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698