| OLD | NEW |
| 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 4940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4951 FrameTestHelpers::WebViewHelper newWebViewHelper; | 4951 FrameTestHelpers::WebViewHelper newWebViewHelper; |
| 4952 WebView* newView = newWebViewHelper.initialize(true); | 4952 WebView* newView = newWebViewHelper.initialize(true); |
| 4953 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame()); | 4953 newView->mainFrame()->setOpener(webViewHelper.webView()->mainFrame()); |
| 4954 runPendingTasks(); | 4954 runPendingTasks(); |
| 4955 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); | 4955 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); |
| 4956 | 4956 |
| 4957 // Access the initial document with document.write, which moves us past the | 4957 // Access the initial document with document.write, which moves us past the |
| 4958 // initial empty document state of the state machine. We normally set a | 4958 // initial empty document state of the state machine. We normally set a |
| 4959 // timer to notify the client. | 4959 // timer to notify the client. |
| 4960 newView->mainFrame()->executeScript( | 4960 newView->mainFrame()->executeScript( |
| 4961 WebScriptSource("window.opener.document.write('Modified');")); | 4961 WebScriptSource("window.opener.document.write('Modified'); window.opener
.document.close();")); |
| 4962 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); | 4962 EXPECT_FALSE(webFrameClient.m_didAccessInitialDocument); |
| 4963 | 4963 |
| 4964 // Make sure that a modal dialog forces us to notify right away. | 4964 // Make sure that a modal dialog forces us to notify right away. |
| 4965 newView->mainFrame()->executeScript( | 4965 newView->mainFrame()->executeScript( |
| 4966 WebScriptSource("window.opener.confirm('Modal');")); | 4966 WebScriptSource("window.opener.confirm('Modal');")); |
| 4967 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); | 4967 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); |
| 4968 | 4968 |
| 4969 // Ensure that we don't notify again later. | 4969 // Ensure that we don't notify again later. |
| 4970 runPendingTasks(); | 4970 runPendingTasks(); |
| 4971 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); | 4971 EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument); |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6272 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6272 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6273 | 6273 |
| 6274 // Neither should a page reload. | 6274 // Neither should a page reload. |
| 6275 localFrame->reload(); | 6275 localFrame->reload(); |
| 6276 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6276 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
| 6277 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6277 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
| 6278 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6278 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
| 6279 } | 6279 } |
| 6280 | 6280 |
| 6281 } // namespace | 6281 } // namespace |
| OLD | NEW |