| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 chrome::GetBrowserCount(browser->profile(), | 85 chrome::GetBrowserCount(browser->profile(), |
| 86 browser->host_desktop_type())); | 86 browser->host_desktop_type())); |
| 87 EXPECT_EQ(num_tabs, browser->tab_strip_model()->count()); | 87 EXPECT_EQ(num_tabs, browser->tab_strip_model()->count()); |
| 88 EXPECT_EQ(num_panels, GetPanelCount(browser)); | 88 EXPECT_EQ(num_panels, GetPanelCount(browser)); |
| 89 | 89 |
| 90 int num_popups_seen = 0; | 90 int num_popups_seen = 0; |
| 91 for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) { | 91 for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) { |
| 92 if (*iter == browser) | 92 if (*iter == browser) |
| 93 continue; | 93 continue; |
| 94 | 94 |
| 95 // Check for TYPE_POPUP. | |
| 96 #if defined(USE_ASH_PANELS) | |
| 97 // On Ash, panel windows may open as popup windows. | |
| 98 EXPECT_TRUE((*iter)->is_type_popup() || (*iter)->is_type_panel()); | |
| 99 #else | |
| 100 EXPECT_TRUE((*iter)->is_type_popup()); | 95 EXPECT_TRUE((*iter)->is_type_popup()); |
| 101 #endif | |
| 102 ++num_popups_seen; | 96 ++num_popups_seen; |
| 103 } | 97 } |
| 104 EXPECT_EQ(num_popups, num_popups_seen); | 98 EXPECT_EQ(num_popups, num_popups_seen); |
| 105 | 99 |
| 106 return ((num_browsers == | 100 return ((num_browsers == |
| 107 chrome::GetBrowserCount(browser->profile(), | 101 chrome::GetBrowserCount(browser->profile(), |
| 108 browser->host_desktop_type())) && | 102 browser->host_desktop_type())) && |
| 109 (num_tabs == browser->tab_strip_model()->count()) && | 103 (num_tabs == browser->tab_strip_model()->count()) && |
| 110 (num_panels == GetPanelCount(browser)) && | 104 (num_panels == GetPanelCount(browser)) && |
| 111 (num_popups == num_popups_seen)); | 105 (num_popups == num_popups_seen)); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), | 447 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), |
| 454 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + | 448 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + |
| 455 "/newtab.html"), false, &newtab)); | 449 "/newtab.html"), false, &newtab)); |
| 456 | 450 |
| 457 // Extension API should succeed. | 451 // Extension API should succeed. |
| 458 bool result = false; | 452 bool result = false; |
| 459 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", | 453 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", |
| 460 &result)); | 454 &result)); |
| 461 EXPECT_TRUE(result); | 455 EXPECT_TRUE(result); |
| 462 } | 456 } |
| OLD | NEW |