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) { | |
Erik does not do reviews
2011/05/25 15:13:03
Could you add a test where the app opens a popup t
prasadt
2011/05/25 17:53:00
Done.
| |
53 ASSERT_TRUE(LoadExtension( | |
54 test_data_dir_.AppendASCII("window_open").AppendASCII("browser_is_app"))); | |
55 | |
56 WaitForTabsAndPopups(browser(), 0, 1); | |
57 | |
58 BrowserList::const_iterator iter = BrowserList::begin(); | |
59 if (browser() == *iter) | |
60 ++iter; | |
61 | |
62 ASSERT_FALSE(browser()->is_app()); | |
63 ASSERT_TRUE((*iter)->is_app()); | |
64 } | |
65 | |
52 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PopupBlockingExtension) { | 66 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PopupBlockingExtension) { |
53 host_resolver()->AddRule("*", "127.0.0.1"); | 67 host_resolver()->AddRule("*", "127.0.0.1"); |
54 ASSERT_TRUE(StartTestServer()); | 68 ASSERT_TRUE(StartTestServer()); |
55 | 69 |
56 ASSERT_TRUE(LoadExtension( | 70 ASSERT_TRUE(LoadExtension( |
57 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") | 71 test_data_dir_.AppendASCII("window_open").AppendASCII("popup_blocking") |
58 .AppendASCII("extension"))); | 72 .AppendASCII("extension"))); |
59 | 73 |
60 WaitForTabsAndPopups(browser(), 5, 3); | 74 WaitForTabsAndPopups(browser(), 5, 3); |
61 } | 75 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 ExtensionApiTest::SetUpCommandLine(command_line); | 123 ExtensionApiTest::SetUpCommandLine(command_line); |
110 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 124 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
111 command_line->AppendSwitch(switches::kEnablePanels); | 125 command_line->AppendSwitch(switches::kEnablePanels); |
112 } | 126 } |
113 }; | 127 }; |
114 | 128 |
115 // TODO(jianli): Enable it when Panel::CreateNativePanel is implemented. | 129 // TODO(jianli): Enable it when Panel::CreateNativePanel is implemented. |
116 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, DISABLED_WindowOpenPanel) { | 130 IN_PROC_BROWSER_TEST_F(WindowOpenPanelTest, DISABLED_WindowOpenPanel) { |
117 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; | 131 ASSERT_TRUE(RunExtensionTest("window_open/panel")) << message_; |
118 } | 132 } |
OLD | NEW |