Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: chrome/browser/extensions/window_open_apitest.cc

Issue 13139004: Deprecate Browser::TYPE_PANEL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(), 460 OpenWindow(browser()->tab_strip_model()->GetActiveWebContents(),
467 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ + 461 GURL(std::string("chrome-extension://") + last_loaded_extension_id_ +
468 "/newtab.html"), false, &newtab)); 462 "/newtab.html"), false, &newtab));
469 463
470 // Extension API should succeed. 464 // Extension API should succeed.
471 bool result = false; 465 bool result = false;
472 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()", 466 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(newtab, "testExtensionApi()",
473 &result)); 467 &result));
474 EXPECT_TRUE(result); 468 EXPECT_TRUE(result);
475 } 469 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698