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 7050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7061 mainFrame()->executeScript(WebScriptSource( | 7061 mainFrame()->executeScript(WebScriptSource( |
7062 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); | 7062 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da
ta:text/html,hi'")); |
7063 ASSERT_FALSE(client.lastRequest().isNull()); | 7063 ASSERT_FALSE(client.lastRequest().isNull()); |
7064 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); | 7064 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); |
7065 | 7065 |
7066 // Manually reset to break WebViewHelper's dependency on the stack allocated | 7066 // Manually reset to break WebViewHelper's dependency on the stack allocated |
7067 // TestWebFrameClient. | 7067 // TestWebFrameClient. |
7068 reset(); | 7068 reset(); |
7069 } | 7069 } |
7070 | 7070 |
| 7071 TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame) |
| 7072 { |
| 7073 RemoteNavigationClient remoteClient; |
| 7074 WebRemoteFrame* remoteFrame = remoteClient.frame(); |
| 7075 mainFrame()->firstChild()->swap(remoteFrame); |
| 7076 remoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http:/
/127.0.0.1")); |
| 7077 |
| 7078 KURL destination = toKURL("data:text/html:destination"); |
| 7079 ASSERT_TRUE(mainFrame()->isWebLocalFrame()); |
| 7080 ASSERT_TRUE(mainFrame()->firstChild()->isWebRemoteFrame()); |
| 7081 LocalDOMWindow* mainWindow = toWebLocalFrameImpl(mainFrame())->frame()->loca
lDOMWindow(); |
| 7082 mainWindow->open(destination.string(), "frame1", "", mainWindow, mainWindow)
; |
| 7083 ASSERT_FALSE(remoteClient.lastRequest().isNull()); |
| 7084 EXPECT_EQ(remoteClient.lastRequest().url(), WebURL(destination)); |
| 7085 |
| 7086 reset(); |
| 7087 } |
| 7088 |
7071 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 7089 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
7072 public: | 7090 public: |
7073 explicit CommitTypeWebFrameClient() | 7091 explicit CommitTypeWebFrameClient() |
7074 : m_historyCommitType(WebHistoryInertCommit) | 7092 : m_historyCommitType(WebHistoryInertCommit) |
7075 { | 7093 { |
7076 } | 7094 } |
7077 | 7095 |
7078 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override | 7096 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist
oryCommitType historyCommitType) override |
7079 { | 7097 { |
7080 m_historyCommitType = historyCommitType; | 7098 m_historyCommitType = historyCommitType; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7267 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); | 7285 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); |
7268 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); | 7286 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8()
.find("Blocked a frame")); |
7269 | 7287 |
7270 // Manually reset to break WebViewHelpers' dependencies on the stack | 7288 // Manually reset to break WebViewHelpers' dependencies on the stack |
7271 // allocated WebFrameClients. | 7289 // allocated WebFrameClients. |
7272 webViewHelper.reset(); | 7290 webViewHelper.reset(); |
7273 popupWebViewHelper.reset(); | 7291 popupWebViewHelper.reset(); |
7274 } | 7292 } |
7275 | 7293 |
7276 } // namespace blink | 7294 } // namespace blink |
OLD | NEW |