| 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_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 class WindowOpenPanelTest : public ExtensionApiTest { | 201 class WindowOpenPanelTest : public ExtensionApiTest { |
| 202 virtual void SetUpCommandLine(CommandLine* command_line) { | 202 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 203 ExtensionApiTest::SetUpCommandLine(command_line); | 203 ExtensionApiTest::SetUpCommandLine(command_line); |
| 204 command_line->AppendSwitch(switches::kEnablePanels); | 204 command_line->AppendSwitch(switches::kEnablePanels); |
| 205 } | 205 } |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 #if defined(USE_ASH) | 208 #if defined(USE_ASH) |
| 209 // On Ash, this currently fails because we're currently opening new panel | 209 // On Ash, this currently fails because we're currently opening new panel |
| 210 // windows as popup windows instead. | 210 // windows as popup windows instead. |
| 211 #define MAYBE_WindowOpenPanel FAILS_WindowOpenPanel | 211 #define MAYBE_WindowOpenPanel DISABLED_WindowOpenPanel |
| 212 #else | 212 #else |
| 213 #define MAYBE_WindowOpenPanel WindowOpenPanel | 213 #define MAYBE_WindowOpenPanel WindowOpenPanel |
| 214 #endif | 214 #endif |
| 215 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanel) { | 215 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanel) { |
| 216 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; | 216 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; |
| 217 } | 217 } |
| 218 | 218 |
| 219 #if defined(USE_ASH) | 219 #if defined(USE_ASH) |
| 220 // On Ash, this currently fails because we're currently opening new panel | 220 // On Ash, this currently fails because we're currently opening new panel |
| 221 // windows as popup windows instead. | 221 // windows as popup windows instead. |
| 222 #define MAYBE_WindowOpenPanelDetached FAILS_WindowOpenPanelDetached | 222 #define MAYBE_WindowOpenPanelDetached DISABLED_WindowOpenPanelDetached |
| 223 #else | 223 #else |
| 224 #define MAYBE_WindowOpenPanelDetached WindowOpenPanelDetached | 224 #define MAYBE_WindowOpenPanelDetached WindowOpenPanelDetached |
| 225 #endif | 225 #endif |
| 226 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanelDetached) { | 226 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, MAYBE_WindowOpenPanelDetached) { |
| 227 ASSERT_TRUE(RunExtensionTest("window_open/panel_detached")) << message_; | 227 ASSERT_TRUE(RunExtensionTest("window_open/panel_detached")) << message_; |
| 228 } | 228 } |
| 229 | 229 |
| 230 #if defined(OS_MACOSX) || defined(OS_WIN) | 230 #if defined(OS_MACOSX) || defined(OS_WIN) |
| 231 // Focus test fails if there is no window manager on Linux. | 231 // Focus test fails if there is no window manager on Linux. |
| 232 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, WindowOpenFocus) { | 232 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, WindowOpenFocus) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 ASSERT_NO_FATAL_FAILURE(OpenWindow(chrome::GetActiveWebContents(browser()), | 410 ASSERT_NO_FATAL_FAILURE(OpenWindow(chrome::GetActiveWebContents(browser()), |
| 411 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + | 411 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + |
| 412 "/newtab.html"), false, &newtab)); | 412 "/newtab.html"), false, &newtab)); |
| 413 | 413 |
| 414 // Extension API should succeed. | 414 // Extension API should succeed. |
| 415 bool result = false; | 415 bool result = false; |
| 416 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 416 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
| 417 newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); | 417 newtab->GetRenderViewHost(), L"", L"testExtensionApi()", &result)); |
| 418 EXPECT_TRUE(result); | 418 EXPECT_TRUE(result); |
| 419 } | 419 } |
| OLD | NEW |