| 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 6931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6942 WebView* new_view = new_web_view_helper.InitializeWithOpener( | 6942 WebView* new_view = new_web_view_helper.InitializeWithOpener( |
| 6943 web_view_helper.WebView()->MainFrame(), true); | 6943 web_view_helper.WebView()->MainFrame(), true); |
| 6944 RunPendingTasks(); | 6944 RunPendingTasks(); |
| 6945 EXPECT_FALSE(web_frame_client.did_access_initial_document_); | 6945 EXPECT_FALSE(web_frame_client.did_access_initial_document_); |
| 6946 | 6946 |
| 6947 // Access the initial document by modifying the body. | 6947 // Access the initial document by modifying the body. |
| 6948 new_view->MainFrame()->ExecuteScript( | 6948 new_view->MainFrame()->ExecuteScript( |
| 6949 WebScriptSource("window.opener.document.body.innerHTML += 'Modified';")); | 6949 WebScriptSource("window.opener.document.body.innerHTML += 'Modified';")); |
| 6950 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6950 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6951 | 6951 |
| 6952 // Run a modal dialog, which used to run a nested message loop and require | 6952 // Run a modal dialog, which used to run a nested run loop and require |
| 6953 // a special case for notifying about the access. | 6953 // a special case for notifying about the access. |
| 6954 new_view->MainFrame()->ExecuteScript( | 6954 new_view->MainFrame()->ExecuteScript( |
| 6955 WebScriptSource("window.opener.confirm('Modal');")); | 6955 WebScriptSource("window.opener.confirm('Modal');")); |
| 6956 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6956 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6957 | 6957 |
| 6958 // Ensure that we don't notify again later. | 6958 // Ensure that we don't notify again later. |
| 6959 RunPendingTasks(); | 6959 RunPendingTasks(); |
| 6960 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6960 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6961 } | 6961 } |
| 6962 | 6962 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 6979 RunPendingTasks(); | 6979 RunPendingTasks(); |
| 6980 EXPECT_FALSE(web_frame_client.did_access_initial_document_); | 6980 EXPECT_FALSE(web_frame_client.did_access_initial_document_); |
| 6981 | 6981 |
| 6982 // Access the initial document with document.write, which moves us past the | 6982 // Access the initial document with document.write, which moves us past the |
| 6983 // initial empty document state of the state machine. | 6983 // initial empty document state of the state machine. |
| 6984 new_view->MainFrame()->ExecuteScript( | 6984 new_view->MainFrame()->ExecuteScript( |
| 6985 WebScriptSource("window.opener.document.write('Modified'); " | 6985 WebScriptSource("window.opener.document.write('Modified'); " |
| 6986 "window.opener.document.close();")); | 6986 "window.opener.document.close();")); |
| 6987 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6987 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6988 | 6988 |
| 6989 // Run a modal dialog, which used to run a nested message loop and require | 6989 // Run a modal dialog, which used to run a nested run loop and require |
| 6990 // a special case for notifying about the access. | 6990 // a special case for notifying about the access. |
| 6991 new_view->MainFrame()->ExecuteScript( | 6991 new_view->MainFrame()->ExecuteScript( |
| 6992 WebScriptSource("window.opener.confirm('Modal');")); | 6992 WebScriptSource("window.opener.confirm('Modal');")); |
| 6993 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6993 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6994 | 6994 |
| 6995 // Ensure that we don't notify again later. | 6995 // Ensure that we don't notify again later. |
| 6996 RunPendingTasks(); | 6996 RunPendingTasks(); |
| 6997 EXPECT_TRUE(web_frame_client.did_access_initial_document_); | 6997 EXPECT_TRUE(web_frame_client.did_access_initial_document_); |
| 6998 } | 6998 } |
| 6999 | 6999 |
| (...skipping 5043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12043 | 12043 |
| 12044 // Failing the original child frame navigation and trying to render fallback | 12044 // Failing the original child frame navigation and trying to render fallback |
| 12045 // content shouldn't crash. It should return NoLoadInProgress. This is so the | 12045 // content shouldn't crash. It should return NoLoadInProgress. This is so the |
| 12046 // caller won't attempt to replace the correctly empty frame with an error | 12046 // caller won't attempt to replace the correctly empty frame with an error |
| 12047 // page. | 12047 // page. |
| 12048 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, | 12048 EXPECT_EQ(WebLocalFrame::NoLoadInProgress, |
| 12049 child->MaybeRenderFallbackContent(WebURLError())); | 12049 child->MaybeRenderFallbackContent(WebURLError())); |
| 12050 } | 12050 } |
| 12051 | 12051 |
| 12052 } // namespace blink | 12052 } // namespace blink |
| OLD | NEW |