OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "chrome/test/ui_test_utils.h" | 10 #include "chrome/test/ui_test_utils.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 continue; | 42 continue; |
43 | 43 |
44 // Check for TYPE_POPUP or TYPE_PANEL. | 44 // Check for TYPE_POPUP or TYPE_PANEL. |
45 ASSERT_TRUE((*iter)->is_type_popup() || (*iter)->is_type_panel()); | 45 ASSERT_TRUE((*iter)->is_type_popup() || (*iter)->is_type_panel()); |
46 } | 46 } |
47 | 47 |
48 break; | 48 break; |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
| 52 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, BrowserIsApp) { |
| 53 host_resolver()->AddRule("a.com", "127.0.0.1"); |
| 54 ASSERT_TRUE(StartTestServer()); |
| 55 ASSERT_TRUE(LoadExtension( |
| 56 test_data_dir_.AppendASCII("window_open").AppendASCII("browser_is_app"))); |
| 57 |
| 58 WaitForTabsAndPopups(browser(), 0, 2); |
| 59 |
| 60 for (BrowserList::const_iterator iter = BrowserList::begin(); |
| 61 iter != BrowserList::end(); ++iter) { |
| 62 if (*iter == browser()) |
| 63 ASSERT_FALSE((*iter)->is_app()); |
| 64 else |
| 65 ASSERT_TRUE((*iter)->is_app()); |
| 66 } |
| 67 } |
| 68 |
52 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PopupBlockingExtension) { | 69 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PopupBlockingExtension) { |
53 host_resolver()->AddRule("*", "127.0.0.1"); | 70 host_resolver()->AddRule("*", "127.0.0.1"); |
54 ASSERT_TRUE(StartTestServer()); | 71 ASSERT_TRUE(StartTestServer()); |
55 | 72 |
56 ASSERT_TRUE(LoadExtension( | 73 ASSERT_TRUE(LoadExtension( |
57 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") | 74 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") |
58 .AppendASCII("extension"))); | 75 .AppendASCII("extension"))); |
59 | 76 |
60 WaitForTabsAndPopups(browser(), 5, 3); | 77 WaitForTabsAndPopups(browser(), 5, 3); |
61 } | 78 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 ExtensionApiTest::SetUpCommandLine(command_line); | 126 ExtensionApiTest::SetUpCommandLine(command_line); |
110 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 127 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
111 command_line->AppendSwitch(switches::kEnablePanels); | 128 command_line->AppendSwitch(switches::kEnablePanels); |
112 } | 129 } |
113 }; | 130 }; |
114 | 131 |
115 // TODO(jianli): Enable it when Panel::CreateNativePanel is implemented. | 132 // TODO(jianli): Enable it when Panel::CreateNativePanel is implemented. |
116 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, DISABLED_WindowOpenPanel) { | 133 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, DISABLED_WindowOpenPanel) { |
117 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; | 134 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; |
118 } | 135 } |
OLD | NEW |