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

Unified Diff: chrome/browser/browser_browsertest.cc

Issue 2821011: Removes phantom tabs. (Closed)
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_browsertest.cc
diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc
index 5371199d6575b1009c084a2789554403b2ca7a8e..c33d6cc63c87efbff9b108e300d0fec22e74ffaf 100644
--- a/chrome/browser/browser_browsertest.cc
+++ b/chrome/browser/browser_browsertest.cc
@@ -94,45 +94,11 @@ class MockTabStripModelObserver : public TabStripModelObserver {
class BrowserTest : public ExtensionBrowserTest {
public:
- // Used by phantom tab tests. Creates two tabs, pins the first and makes it
- // a phantom tab (by closing it).
- void PhantomTabTest() {
- HTTPTestServer* server = StartHTTPServer();
- ASSERT_TRUE(server);
- host_resolver()->AddRule("www.example.com", "127.0.0.1");
- GURL url(server->TestServerPage("empty.html"));
- TabStripModel* model = browser()->tabstrip_model();
-
- ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app/")));
-
- Extension* extension_app = GetExtension();
-
- ui_test_utils::NavigateToURL(browser(), url);
-
- TabContents* app_contents = new TabContents(browser()->profile(), NULL,
- MSG_ROUTING_NONE, NULL);
- app_contents->SetExtensionApp(extension_app);
-
- model->AddTabContents(app_contents, 0, false, 0, false);
- model->SetTabPinned(0, true);
- ui_test_utils::NavigateToURL(browser(), url);
-
- // Close the first, which should make it a phantom.
- model->CloseTabContentsAt(0, TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
-
- // There should still be two tabs.
- ASSERT_EQ(2, browser()->tab_count());
- // The first tab should be a phantom.
- EXPECT_TRUE(model->IsPhantomTab(0));
- // And the tab contents of the first tab should have changed.
- EXPECT_TRUE(model->GetTabContentsAt(0) != app_contents);
- }
-
protected:
virtual void SetUpCommandLine(CommandLine* command_line) {
ExtensionBrowserTest::SetUpCommandLine(command_line);
- // Needed for phantom tab tests.
+ // Needed for app tab tests.
command_line->AppendSwitch(switches::kEnableApps);
}
@@ -427,27 +393,6 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconChange) {
// TODO(sky): get these to run on a Mac.
#if !defined(OS_MACOSX)
-IN_PROC_BROWSER_TEST_F(BrowserTest, PhantomTab) {
- PhantomTabTest();
-}
-
-IN_PROC_BROWSER_TEST_F(BrowserTest, RevivePhantomTab) {
- PhantomTabTest();
-
- if (HasFatalFailure())
- return;
-
- TabStripModel* model = browser()->tabstrip_model();
-
- // Revive the phantom tab by selecting it.
- browser()->SelectTabContentsAt(0, true);
-
- // There should still be two tabs.
- ASSERT_EQ(2, browser()->tab_count());
- // The first tab should no longer be a phantom.
- EXPECT_FALSE(model->IsPhantomTab(0));
-}
-
// Makes sure TabClosing is sent when uninstalling an extension that is an app
// tab.
IN_PROC_BROWSER_TEST_F(BrowserTest, TabClosingWhenRemovingExtension) {
@@ -485,15 +430,6 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, TabClosingWhenRemovingExtension) {
ASSERT_EQ(1, browser()->tab_count());
}
-IN_PROC_BROWSER_TEST_F(BrowserTest, AppTabRemovedWhenExtensionUninstalled) {
- PhantomTabTest();
-
- Extension* extension = GetExtension();
- UninstallExtension(extension->id());
-
- // The uninstall should have removed the tab.
- ASSERT_EQ(1, browser()->tab_count());
-}
#endif // !defined(OS_MACOSX)
#if defined(OS_WIN)
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698