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

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

Issue 2526163002: Rename blink::Page's load deferral to suspension (Closed)
Patch Set: Created 4 years 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "core/layout/HitTestResult.h" 67 #include "core/layout/HitTestResult.h"
68 #include "core/layout/LayoutFullScreen.h" 68 #include "core/layout/LayoutFullScreen.h"
69 #include "core/layout/api/LayoutViewItem.h" 69 #include "core/layout/api/LayoutViewItem.h"
70 #include "core/layout/compositing/PaintLayerCompositor.h" 70 #include "core/layout/compositing/PaintLayerCompositor.h"
71 #include "core/loader/DocumentLoader.h" 71 #include "core/loader/DocumentLoader.h"
72 #include "core/loader/DocumentThreadableLoader.h" 72 #include "core/loader/DocumentThreadableLoader.h"
73 #include "core/loader/DocumentThreadableLoaderClient.h" 73 #include "core/loader/DocumentThreadableLoaderClient.h"
74 #include "core/loader/FrameLoadRequest.h" 74 #include "core/loader/FrameLoadRequest.h"
75 #include "core/loader/ThreadableLoader.h" 75 #include "core/loader/ThreadableLoader.h"
76 #include "core/page/Page.h" 76 #include "core/page/Page.h"
77 #include "core/page/ScopedPageLoadDeferrer.h" 77 #include "core/page/ScopedPageSuspender.h"
78 #include "core/paint/PaintLayer.h" 78 #include "core/paint/PaintLayer.h"
79 #include "core/testing/NullExecutionContext.h" 79 #include "core/testing/NullExecutionContext.h"
80 #include "modules/mediastream/MediaStream.h" 80 #include "modules/mediastream/MediaStream.h"
81 #include "modules/mediastream/MediaStreamRegistry.h" 81 #include "modules/mediastream/MediaStreamRegistry.h"
82 #include "platform/Cursor.h" 82 #include "platform/Cursor.h"
83 #include "platform/DragImage.h" 83 #include "platform/DragImage.h"
84 #include "platform/PlatformMouseEvent.h" 84 #include "platform/PlatformMouseEvent.h"
85 #include "platform/PlatformResourceLoader.h" 85 #include "platform/PlatformResourceLoader.h"
86 #include "platform/RuntimeEnabledFeatures.h" 86 #include "platform/RuntimeEnabledFeatures.h"
87 #include "platform/UserGestureIndicator.h" 87 #include "platform/UserGestureIndicator.h"
(...skipping 9359 matching lines...) Expand 10 before | Expand all | Expand 10 after
9447 // Load a page with a child frame in the new root to make sure this doesn't 9447 // Load a page with a child frame in the new root to make sure this doesn't
9448 // crash when the child frame invokes setCoreFrame. 9448 // crash when the child frame invokes setCoreFrame.
9449 registerMockedHttpURLLoad("single_iframe.html"); 9449 registerMockedHttpURLLoad("single_iframe.html");
9450 registerMockedHttpURLLoad("visible_iframe.html"); 9450 registerMockedHttpURLLoad("visible_iframe.html");
9451 FrameTestHelpers::loadFrame(localRoot, m_baseURL + "single_iframe.html"); 9451 FrameTestHelpers::loadFrame(localRoot, m_baseURL + "single_iframe.html");
9452 9452
9453 view->close(); 9453 view->close();
9454 } 9454 }
9455 9455
9456 // See https://crbug.com/628942. 9456 // See https://crbug.com/628942.
9457 TEST_P(ParameterizedWebFrameTest, DeferredPageLoadWithRemoteMainFrame) { 9457 TEST_P(ParameterizedWebFrameTest, SuspendedPageLoadWithRemoteMainFrame) {
9458 // Prepare a page with a remote main frame. 9458 // Prepare a page with a remote main frame.
9459 FrameTestHelpers::TestWebViewClient viewClient; 9459 FrameTestHelpers::TestWebViewClient viewClient;
9460 FrameTestHelpers::TestWebRemoteFrameClient remoteClient; 9460 FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
9461 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); 9461 WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible);
9462 view->setMainFrame(remoteClient.frame()); 9462 view->setMainFrame(remoteClient.frame());
9463 WebRemoteFrame* remoteRoot = view->mainFrame()->toWebRemoteFrame(); 9463 WebRemoteFrame* remoteRoot = view->mainFrame()->toWebRemoteFrame();
9464 remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique()); 9464 remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique());
9465 9465
9466 // Check that ScopedPageLoadDeferrer properly triggers deferred loading for 9466 // Check that ScopedPageSuspender properly triggers deferred loading for
9467 // the current Page. 9467 // the current Page.
9468 Page* page = remoteRoot->toImplBase()->frame()->page(); 9468 Page* page = remoteRoot->toImplBase()->frame()->page();
9469 EXPECT_FALSE(page->defersLoading()); 9469 EXPECT_FALSE(page->suspended());
9470 { 9470 {
9471 ScopedPageLoadDeferrer deferrer; 9471 ScopedPageSuspender suspender;
9472 EXPECT_TRUE(page->defersLoading()); 9472 EXPECT_TRUE(page->suspended());
9473 } 9473 }
9474 EXPECT_FALSE(page->defersLoading()); 9474 EXPECT_FALSE(page->suspended());
9475 9475
9476 // Repeat this for a page with a local child frame, and ensure that the 9476 // Repeat this for a page with a local child frame, and ensure that the
9477 // child frame's loads are also deferred. 9477 // child frame's loads are also suspended.
9478 WebLocalFrame* webLocalChild = FrameTestHelpers::createLocalChild(remoteRoot); 9478 WebLocalFrame* webLocalChild = FrameTestHelpers::createLocalChild(remoteRoot);
9479 registerMockedHttpURLLoad("foo.html"); 9479 registerMockedHttpURLLoad("foo.html");
9480 FrameTestHelpers::loadFrame(webLocalChild, m_baseURL + "foo.html"); 9480 FrameTestHelpers::loadFrame(webLocalChild, m_baseURL + "foo.html");
9481 LocalFrame* localChild = toWebLocalFrameImpl(webLocalChild)->frame(); 9481 LocalFrame* localChild = toWebLocalFrameImpl(webLocalChild)->frame();
9482 EXPECT_FALSE(page->defersLoading()); 9482 EXPECT_FALSE(page->suspended());
9483 EXPECT_FALSE(localChild->document()->fetcher()->defersLoading()); 9483 EXPECT_FALSE(localChild->document()->fetcher()->defersLoading());
9484 { 9484 {
9485 ScopedPageLoadDeferrer deferrer; 9485 ScopedPageSuspender suspender;
9486 EXPECT_TRUE(page->defersLoading()); 9486 EXPECT_TRUE(page->suspended());
9487 EXPECT_TRUE(localChild->document()->fetcher()->defersLoading()); 9487 EXPECT_TRUE(localChild->document()->fetcher()->defersLoading());
9488 } 9488 }
9489 EXPECT_FALSE(page->defersLoading()); 9489 EXPECT_FALSE(page->suspended());
9490 EXPECT_FALSE(localChild->document()->fetcher()->defersLoading()); 9490 EXPECT_FALSE(localChild->document()->fetcher()->defersLoading());
9491 9491
9492 view->close(); 9492 view->close();
9493 } 9493 }
9494 9494
9495 class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient { 9495 class OverscrollWebViewClient : public FrameTestHelpers::TestWebViewClient {
9496 public: 9496 public:
9497 MOCK_METHOD4(didOverscroll, 9497 MOCK_METHOD4(didOverscroll,
9498 void(const WebFloatSize&, 9498 void(const WebFloatSize&,
9499 const WebFloatSize&, 9499 const WebFloatSize&,
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
10796 10796
10797 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); 10797 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached());
10798 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); 10798 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading());
10799 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); 10799 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad());
10800 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); 10800 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents());
10801 10801
10802 webViewHelper.reset(); 10802 webViewHelper.reset();
10803 } 10803 }
10804 10804
10805 } // namespace blink 10805 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698