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

Unified Diff: chrome/browser/task_manager/task_manager_browsertest.cc

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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
Index: chrome/browser/task_manager/task_manager_browsertest.cc
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc
index b6ce18844bdf907eab3ad416dfd1e499531f72c6..e13a9a5d666c0b6eacbe411879254d49823e0467 100644
--- a/chrome/browser/task_manager/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -28,8 +28,6 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/panels/panel.h"
-#include "chrome/browser/ui/panels/panel_manager.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_switches.h"
@@ -307,222 +305,6 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NavigateAwayFromHungRenderer) {
ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchTab("iframe test")));
}
-IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticePanel) {
- ASSERT_TRUE(LoadExtension(
- test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0")));
-
- // Open a new panel to an extension url.
- GURL url(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/french_sentence.html");
- Panel* docked_panel = PanelManager::GetInstance()->CreatePanel(
- web_app::GenerateApplicationNameFromExtensionId(
- last_loaded_extension_id()),
- browser()->profile(), url, nullptr, gfx::Rect(300, 400),
- PanelManager::CREATE_AS_DOCKED);
- docked_panel->Show();
-
- // Make sure that a task manager model created after the panel shows the
- // existence of the panel and the extension.
- ShowTaskManager();
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 1,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(2, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- // Create a second, detached panel.
- Panel* detached_panel = PanelManager::GetInstance()->CreatePanel(
- web_app::GenerateApplicationNameFromExtensionId(
- last_loaded_extension_id()),
- browser()->profile(), url, nullptr, gfx::Rect(150, 150),
- PanelManager::CREATE_AS_DETACHED);
- detached_panel->ShowInactive();
-
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 2, MatchExtension("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(3, MatchAnyExtension()));
-
- // Close the panels and verify that we notice.
- docked_panel->Close();
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(2, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 1, MatchExtension("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
-
- detached_panel->Close();
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 0,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
-}
-
-IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticePanelChanges) {
- ShowTaskManager();
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- ASSERT_TRUE(LoadExtension(
- test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0")));
-
- // Browser, the New Tab Page and Extension background page.
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- // Open a new panel to an extension url and make sure we notice that.
- GURL url(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/french_sentence.html");
- Panel* panel = PanelManager::GetInstance()->CreatePanel(
- web_app::GenerateApplicationNameFromExtensionId(
- last_loaded_extension_id()),
- browser()->profile(),
- url,
- nullptr,
- gfx::Rect(300, 400),
- PanelManager::CREATE_AS_DOCKED);
- panel->ShowInactive();
-
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 1,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(2, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- // Close the panel and verify that we notice.
- panel->Close();
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 0,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
-
- // Unload extension.
- UnloadExtension(last_loaded_extension_id());
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-}
-
-// Kills a process that has more than one task manager entry.
-IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillPanelViaExtensionResource) {
- ShowTaskManager();
- ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("good")
- .AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0")));
-
- // Open a new panel to an extension url.
- GURL url(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html");
- Panel* panel = PanelManager::GetInstance()->CreatePanel(
- web_app::GenerateApplicationNameFromExtensionId(
- last_loaded_extension_id()),
- browser()->profile(),
- url,
- nullptr,
- gfx::Rect(300, 400),
- PanelManager::CREATE_AS_DETACHED);
- panel->Show();
-
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 1,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(2, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- // Kill the process via the BACKGROUND PAGE (not the panel). Verify that both
- // the background page and the panel go away from the task manager.
- int background_page = FindResourceIndex(MatchExtension("My extension 1"));
- ASSERT_NE(-1, background_page);
- ASSERT_EQ(-1, model()->GetTabId(background_page));
- model()->Kill(background_page);
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-}
-
-// Kills a process that has more than one task manager entry. This test is the
-// same as KillPanelViaExtensionResource except it does the kill via the other
-// entry.
-IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, KillPanelViaPanelResource) {
- ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("good")
- .AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0")));
-
- // Open a new panel to an extension url.
- GURL url(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html");
- Panel* panel = PanelManager::GetInstance()->CreatePanel(
- web_app::GenerateApplicationNameFromExtensionId(
- last_loaded_extension_id()),
- browser()->profile(),
- url,
- nullptr,
- gfx::Rect(300, 400),
- PanelManager::CREATE_AS_DETACHED);
- panel->ShowInactive();
-
- ShowTaskManager();
- ASSERT_NO_FATAL_FAILURE(
- WaitForTaskManagerRows(1, MatchExtension("My extension 1")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(
- 1,
- MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html")));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(2, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-
- int background_page = FindResourceIndex(MatchExtension("My extension 1"));
- ASSERT_NE(-1, background_page);
- ASSERT_EQ(-1, model()->GetTabId(background_page));
-
- // Kill the process via the PANEL RESOURCE (not the background page). Verify
- // that both the background page and the panel go away from the task manager.
- int panel_index = FindResourceIndex(MatchExtension(
- "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/"
- "french_sentence.html"));
- ASSERT_NE(-1, panel_index);
- ASSERT_NE(-1, model()->GetTabId(panel_index));
- model()->Kill(panel_index);
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(0, MatchAnyExtension()));
- ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
-}
-
IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeExtensionTabChanges) {
ShowTaskManager();
ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
« no previous file with comments | « chrome/browser/task_manager/providers/web_contents/panel_task.cc ('k') | chrome/browser/task_manager/web_contents_tags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698