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

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

Issue 561813003: Prepare blink to unify definitions of load completion (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add document.close() to scroll-left-while-loading.html Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/ActivityLoggerTest.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 /* 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 5310 matching lines...) Expand 10 before | Expand all | Expand 10 after
5321 FrameTestHelpers::WebViewHelper newWebViewHelper; 5321 FrameTestHelpers::WebViewHelper newWebViewHelper;
5322 WebView* newView = newWebViewHelper.initialize(true); 5322 WebView* newView = newWebViewHelper.initialize(true);
5323 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame()); 5323 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame());
5324 runPendingTasks(); 5324 runPendingTasks();
5325 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); 5325 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
5326 5326
5327 // Access the initial document with document.write, which moves us past the 5327 // Access the initial document with document.write, which moves us past the
5328 // initial empty document state of the state machine. We normally set a 5328 // initial empty document state of the state machine. We normally set a
5329 // timer to notify the client. 5329 // timer to notify the client.
5330 newView->mainFrame()->executeScript( 5330 newView->mainFrame()->executeScript(
5331 WebScriptSource("window.opener.document.write('Modified');")); 5331 WebScriptSource("window.opener.document.write('Modified'); window.opener .document.close();"));
5332 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); 5332 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
5333 5333
5334 // Make sure that a modal dialog forces us to notify right away. 5334 // Make sure that a modal dialog forces us to notify right away.
5335 newView->mainFrame()->executeScript( 5335 newView->mainFrame()->executeScript(
5336 WebScriptSource("window.opener.confirm('Modal');")); 5336 WebScriptSource("window.opener.confirm('Modal');"));
5337 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); 5337 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
5338 5338
5339 // Ensure that we don't notify again later. 5339 // Ensure that we don't notify again later.
5340 runPendingTasks(); 5340 runPendingTasks();
5341 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); 5341 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
6882 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6882 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6883 6883
6884 // Neither should a page reload. 6884 // Neither should a page reload.
6885 localFrame->reload(); 6885 localFrame->reload();
6886 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6886 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6887 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6887 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6888 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6888 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6889 } 6889 }
6890 6890
6891 } // namespace 6891 } // namespace
OLDNEW
« no previous file with comments | « Source/web/tests/ActivityLoggerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698