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

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

Issue 1109213002: Make createWindow (mostly) work with OOPIF (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix style, use FrameView::root Created 5 years, 7 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 7106 matching lines...) Expand 10 before | Expand all | Expand 10 after
7117 mainFrame()->executeScript(WebScriptSource( 7117 mainFrame()->executeScript(WebScriptSource(
7118 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da ta:text/html,hi'")); 7118 "document.getElementsByTagName('iframe')[0].contentWindow.location = 'da ta:text/html,hi'"));
7119 ASSERT_FALSE(client.lastRequest().isNull()); 7119 ASSERT_FALSE(client.lastRequest().isNull());
7120 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url()); 7120 EXPECT_EQ(WebURL(toKURL("data:text/html,hi")), client.lastRequest().url());
7121 7121
7122 // Manually reset to break WebViewHelper's dependency on the stack allocated 7122 // Manually reset to break WebViewHelper's dependency on the stack allocated
7123 // TestWebFrameClient. 7123 // TestWebFrameClient.
7124 reset(); 7124 reset();
7125 } 7125 }
7126 7126
7127 TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame)
7128 {
7129 RemoteNavigationClient remoteClient;
7130 WebRemoteFrame* remoteFrame = remoteClient.frame();
7131 mainFrame()->firstChild()->swap(remoteFrame);
7132 remoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http:/ /127.0.0.1"));
7133
7134 KURL destination = toKURL("data:text/html:destination");
7135 ASSERT_TRUE(mainFrame()->isWebLocalFrame());
7136 ASSERT_TRUE(mainFrame()->firstChild()->isWebRemoteFrame());
7137 LocalDOMWindow* mainWindow = toWebLocalFrameImpl(mainFrame())->frame()->loca lDOMWindow();
7138 mainWindow->open(destination.string(), "frame1", "", mainWindow, mainWindow) ;
7139 ASSERT_FALSE(remoteClient.lastRequest().isNull());
7140 EXPECT_EQ(remoteClient.lastRequest().url(), WebURL(destination));
7141
7142 reset();
7143 }
7144
7127 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient { 7145 class CommitTypeWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
7128 public: 7146 public:
7129 explicit CommitTypeWebFrameClient() 7147 explicit CommitTypeWebFrameClient()
7130 : m_historyCommitType(WebHistoryInertCommit) 7148 : m_historyCommitType(WebHistoryInertCommit)
7131 { 7149 {
7132 } 7150 }
7133 7151
7134 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist oryCommitType historyCommitType) override 7152 void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHist oryCommitType historyCommitType) override
7135 { 7153 {
7136 m_historyCommitType = historyCommitType; 7154 m_historyCommitType = historyCommitType;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
7323 ASSERT_EQ(2u, popupWebFrameClient.messages.size()); 7341 ASSERT_EQ(2u, popupWebFrameClient.messages.size());
7324 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8() .find("Blocked a frame")); 7342 EXPECT_TRUE(std::string::npos != popupWebFrameClient.messages[1].text.utf8() .find("Blocked a frame"));
7325 7343
7326 // Manually reset to break WebViewHelpers' dependencies on the stack 7344 // Manually reset to break WebViewHelpers' dependencies on the stack
7327 // allocated WebFrameClients. 7345 // allocated WebFrameClients.
7328 webViewHelper.reset(); 7346 webViewHelper.reset();
7329 popupWebViewHelper.reset(); 7347 popupWebViewHelper.reset();
7330 } 7348 }
7331 7349
7332 } // namespace blink 7350 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698