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_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
26 #include "extensions/browser/extension_system.h" | 26 #include "extensions/browser/extension_system.h" |
27 #include "extensions/browser/process_manager.h" | 27 #include "extensions/browser/process_manager.h" |
28 #include "extensions/common/extension.h" | 28 #include "extensions/common/extension.h" |
29 #include "extensions/common/switches.h" | 29 #include "extensions/common/switches.h" |
30 #include "net/dns/mock_host_resolver.h" | 30 #include "net/dns/mock_host_resolver.h" |
31 #include "net/test/embedded_test_server/embedded_test_server.h" | 31 #include "net/test/embedded_test_server/embedded_test_server.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 | 33 |
34 #if defined(USE_ASH) | 34 #if defined(USE_ASH) |
35 #include "apps/shell_window_registry.h" | 35 #include "apps/app_window_registry.h" |
36 #endif | 36 #endif |
37 | 37 |
38 #if defined(USE_ASH) && !defined(OS_WIN) | 38 #if defined(USE_ASH) && !defined(OS_WIN) |
39 // TODO(stevenjb): Figure out the correct behavior for Ash + Win | 39 // TODO(stevenjb): Figure out the correct behavior for Ash + Win |
40 #define USE_ASH_PANELS | 40 #define USE_ASH_PANELS |
41 #endif | 41 #endif |
42 | 42 |
43 using content::OpenURLParams; | 43 using content::OpenURLParams; |
44 using content::Referrer; | 44 using content::Referrer; |
45 using content::WebContents; | 45 using content::WebContents; |
46 | 46 |
47 // Disabled, http://crbug.com/64899. | 47 // Disabled, http://crbug.com/64899. |
48 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) { | 48 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_WindowOpen) { |
49 CommandLine::ForCurrentProcess()->AppendSwitch( | 49 CommandLine::ForCurrentProcess()->AppendSwitch( |
50 extensions::switches::kEnableExperimentalExtensionApis); | 50 extensions::switches::kEnableExperimentalExtensionApis); |
51 | 51 |
52 ResultCatcher catcher; | 52 ResultCatcher catcher; |
53 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ | 53 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ |
54 .AppendASCII("window_open").AppendASCII("spanning"))); | 54 .AppendASCII("window_open").AppendASCII("spanning"))); |
55 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 55 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
56 } | 56 } |
57 | 57 |
58 int GetPanelCount(Browser* browser) { | 58 int GetPanelCount(Browser* browser) { |
59 #if defined(USE_ASH_PANELS) | 59 #if defined(USE_ASH_PANELS) |
60 return static_cast<int>(apps::ShellWindowRegistry::Get( | 60 return static_cast<int>( |
61 browser->profile())->shell_windows().size()); | 61 apps::AppWindowRegistry::Get(browser->profile())->app_windows().size()); |
62 #else | 62 #else |
63 return PanelManager::GetInstance()->num_panels(); | 63 return PanelManager::GetInstance()->num_panels(); |
64 #endif | 64 #endif |
65 } | 65 } |
66 | 66 |
67 bool WaitForTabsAndPopups(Browser* browser, | 67 bool WaitForTabsAndPopups(Browser* browser, |
68 int num_tabs, | 68 int num_tabs, |
69 int num_popups, | 69 int num_popups, |
70 int num_panels) { | 70 int num_panels) { |
71 SCOPED_TRACE( | 71 SCOPED_TRACE( |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), | 486 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), |
487 GURL(std::string("chrome-extension://") + last_loaded_extension_id() + | 487 GURL(std::string("chrome-extension://") + last_loaded_extension_id() + |
488 "/newtab.html"), false, &newtab)); | 488 "/newtab.html"), false, &newtab)); |
489 | 489 |
490 // Extension API should succeed. | 490 // Extension API should succeed. |
491 bool result = false; | 491 bool result = false; |
492 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", | 492 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", |
493 &result)); | 493 &result)); |
494 EXPECT_TRUE(result); | 494 EXPECT_TRUE(result); |
495 } | 495 } |
OLD | NEW |