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

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: 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
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 5251 matching lines...) Expand 10 before | Expand all | Expand 10 after
5262 FrameTestHelpers::WebViewHelper newWebViewHelper; 5262 FrameTestHelpers::WebViewHelper newWebViewHelper;
5263 WebView* newView = newWebViewHelper.initialize(true); 5263 WebView* newView = newWebViewHelper.initialize(true);
5264 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame()); 5264 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame());
5265 runPendingTasks(); 5265 runPendingTasks();
5266 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); 5266 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
5267 5267
5268 // Access the initial document with document.write, which moves us past the 5268 // Access the initial document with document.write, which moves us past the
5269 // initial empty document state of the state machine. We normally set a 5269 // initial empty document state of the state machine. We normally set a
5270 // timer to notify the client. 5270 // timer to notify the client.
5271 newView->mainFrame()->executeScript( 5271 newView->mainFrame()->executeScript(
5272 WebScriptSource("window.opener.document.write('Modified');")); 5272 WebScriptSource("window.opener.document.write('Modified'); window.opener .document.close();"));
5273 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); 5273 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument);
5274 5274
5275 // Make sure that a modal dialog forces us to notify right away. 5275 // Make sure that a modal dialog forces us to notify right away.
5276 newView->mainFrame()->executeScript( 5276 newView->mainFrame()->executeScript(
5277 WebScriptSource("window.opener.confirm('Modal');")); 5277 WebScriptSource("window.opener.confirm('Modal');"));
5278 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); 5278 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
5279 5279
5280 // Ensure that we don't notify again later. 5280 // Ensure that we don't notify again later.
5281 runPendingTasks(); 5281 runPendingTasks();
5282 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); 5282 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
6823 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6823 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6824 6824
6825 // Neither should a page reload. 6825 // Neither should a page reload.
6826 localFrame->reload(); 6826 localFrame->reload();
6827 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6827 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6828 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6828 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6829 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6829 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6830 } 6830 }
6831 6831
6832 } // namespace 6832 } // namespace
OLDNEW
« Source/core/fetch/Resource.h ('K') | « Source/web/tests/ActivityLoggerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698