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

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

Issue 1991273003: Fire visibilityChange event on out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/dom/Document.h" 6 #include "core/dom/Document.h"
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/html/HTMLIFrameElement.h" 10 #include "core/html/HTMLIFrameElement.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 EXPECT_FALSE(compositor().hasSelection()); 419 EXPECT_FALSE(compositor().hasSelection());
420 document().page()->focusController().setFocusedFrame(frameElement->contentDo cument()->frame()); 420 document().page()->focusController().setFocusedFrame(frameElement->contentDo cument()->frame());
421 document().body()->setAttribute(styleAttr, "background: green"); 421 document().body()->setAttribute(styleAttr, "background: green");
422 compositeFrame(); 422 compositeFrame();
423 EXPECT_FALSE(compositor().hasSelection()); 423 EXPECT_FALSE(compositor().hasSelection());
424 } 424 }
425 425
426 TEST(RemoteFrameThrottlingTest, ThrottledLocalRoot) 426 TEST(RemoteFrameThrottlingTest, ThrottledLocalRoot)
427 { 427 {
428 FrameTestHelpers::TestWebViewClient viewClient; 428 FrameTestHelpers::TestWebViewClient viewClient;
429 WebViewImpl* webView = WebViewImpl::create(&viewClient); 429 WebViewImpl* webView = WebViewImpl::create(&viewClient, WebPageVisibilitySta teVisible);
430 webView->resize(WebSize(640, 480)); 430 webView->resize(WebSize(640, 480));
431 431
432 // Create a remote root frame with a local child frame. 432 // Create a remote root frame with a local child frame.
433 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 433 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
434 webView->setMainFrame(remoteClient.frame()); 434 webView->setMainFrame(remoteClient.frame());
435 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique()) ; 435 remoteClient.frame()->setReplicatedOrigin(WebSecurityOrigin::createUnique()) ;
436 436
437 WebFrameOwnerProperties properties; 437 WebFrameOwnerProperties properties;
438 WebRemoteFrame* rootFrame = webView->mainFrame()->toWebRemoteFrame(); 438 WebRemoteFrame* rootFrame = webView->mainFrame()->toWebRemoteFrame();
439 WebLocalFrame* localFrame = FrameTestHelpers::createLocalChild(rootFrame); 439 WebLocalFrame* localFrame = FrameTestHelpers::createLocalChild(rootFrame);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 localFrame->script().executeScriptInMainWorld( 845 localFrame->script().executeScriptInMainWorld(
846 "window.requestAnimationFrame(function() {\n" 846 "window.requestAnimationFrame(function() {\n"
847 " var throttledFrame = window.parent.frames.first;\n" 847 " var throttledFrame = window.parent.frames.first;\n"
848 " throttledFrame.document.documentElement.style = 'margin: 50px';\n" 848 " throttledFrame.document.documentElement.style = 'margin: 50px';\n"
849 " throttledFrame.document.querySelector('#d').getBoundingClientRect();\ n" 849 " throttledFrame.document.querySelector('#d').getBoundingClientRect();\ n"
850 "});\n"); 850 "});\n");
851 compositeFrame(); 851 compositeFrame();
852 } 852 }
853 853
854 } // namespace blink 854 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698