| 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/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 9 #include "chrome/browser/extensions/extension_test_message_listener.h" | 9 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 #define MAYBE_WindowOpenPanel FAILS_WindowOpenPanel | 200 #define MAYBE_WindowOpenPanel FAILS_WindowOpenPanel |
| 201 #else | 201 #else |
| 202 #define MAYBE_WindowOpenPanel WindowOpenPanel | 202 #define MAYBE_WindowOpenPanel WindowOpenPanel |
| 203 #endif | 203 #endif |
| 204 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanel) { | 204 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanel) { |
| 205 if (!PanelManager::UseBrowserlessPanels()) | 205 if (!PanelManager::UseBrowserlessPanels()) |
| 206 return; | 206 return; |
| 207 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; | 207 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; |
| 208 } | 208 } |
| 209 | 209 |
| 210 #if defined(USE_ASH) |
| 211 // On Ash, this currently fails because we're currently opening new panel |
| 212 // windows as popup windows instead. |
| 213 #define MAYBE_WindowOpenPanelDetached FAILS_WindowOpenPanelDetached |
| 214 #else |
| 215 #define MAYBE_WindowOpenPanelDetached WindowOpenPanelDetached |
| 216 #endif |
| 217 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanelDetached) { |
| 218 if (!PanelManager::UseBrowserlessPanels()) |
| 219 return; |
| 220 ASSERT_TRUE(RunExtensionTest("window_open/panel_detached")) << message_; |
| 221 } |
| 222 |
| 210 #if defined(OS_MACOSX) || defined(OS_WIN) | 223 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 211 // Focus test fails if there is no window manager on Linux. | 224 // Focus test fails if there is no window manager on Linux. |
| 212 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, WindowOpenFocus) { | 225 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, WindowOpenFocus) { |
| 213 if (!PanelManager::UseBrowserlessPanels()) | 226 if (!PanelManager::UseBrowserlessPanels()) |
| 214 return; | 227 return; |
| 215 ASSERT_TRUE(RunExtensionTest("window_open/focus")) << message_; | 228 ASSERT_TRUE(RunExtensionTest("window_open/focus")) << message_; |
| 216 } | 229 } |
| 217 #endif | 230 #endif |
| 218 | 231 |
| 219 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, | 232 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 ASSERT_NO_FATAL_FAILURE(OpenWindow(chrome::GetActiveWebContents(browser()), | 337 ASSERT_NO_FATAL_FAILURE(OpenWindow(chrome::GetActiveWebContents(browser()), |
| 325 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + | 338 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + |
| 326 "/newtab.html"), false, &newtab)); | 339 "/newtab.html"), false, &newtab)); |
| 327 | 340 |
| 328 // Extension API should succeed. | 341 // Extension API should succeed. |
| 329 bool result = false; | 342 bool result = false; |
| 330 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 343 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
| 331 newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); | 344 newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); |
| 332 EXPECT_TRUE(result); | 345 EXPECT_TRUE(result); |
| 333 } | 346 } |
| OLD | NEW |