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

Side by Side Diff: chrome/browser/extensions/window_open_apitest.cc

Issue 527913002: Don't change the window disposition for new windows without a user gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowOpenPopupIframe) { 142 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowOpenPopupIframe) {
143 ASSERT_TRUE(StartEmbeddedTestServer()); 143 ASSERT_TRUE(StartEmbeddedTestServer());
144 base::FilePath test_data_dir; 144 base::FilePath test_data_dir;
145 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); 145 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
146 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); 146 embedded_test_server()->ServeFilesFromDirectory(test_data_dir);
147 ASSERT_TRUE(LoadExtension( 147 ASSERT_TRUE(LoadExtension(
148 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_iframe"))); 148 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_iframe")));
149 149
150 const int num_tabs = 0; 150 const int num_tabs = 1;
151 const int num_popups = 1; 151 const int num_popups = 0;
152 EXPECT_TRUE(WaitForTabsAndPopups(browser(), num_tabs, num_popups, 0)); 152 EXPECT_TRUE(WaitForTabsAndPopups(browser(), num_tabs, num_popups, 0));
153 } 153 }
154 154
155 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowOpenPopupLarge) { 155 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowOpenPopupLarge) {
156 ASSERT_TRUE(StartEmbeddedTestServer()); 156 ASSERT_TRUE(StartEmbeddedTestServer());
157 ASSERT_TRUE(LoadExtension( 157 ASSERT_TRUE(LoadExtension(
158 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_large"))); 158 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_large")));
159 159
160 // On other systems this should open a new popup window. 160 // On other systems this should open a new popup window.
161 const int num_tabs = 0; 161 const int num_tabs = 0;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 last_loaded_extension_id() + "/newtab.html"), 503 last_loaded_extension_id() + "/newtab.html"),
504 false, 504 false,
505 &newtab)); 505 &newtab));
506 506
507 // Extension API should succeed. 507 // Extension API should succeed.
508 bool result = false; 508 bool result = false;
509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", 509 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()",
510 &result)); 510 &result));
511 EXPECT_TRUE(result); 511 EXPECT_TRUE(result);
512 } 512 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698