| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |