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

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

Issue 1956813002: [Part 1 of 6] Move MockWebContentsTaskManager into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extend coverage of TaskManagerBrowserTest.NoticePanel to replace the coverage that had been in pane… Created 4 years, 7 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 3b2e26faf24f4da2562e92a462a16da2c81ea23e..0f3f17b7494e1dbeb0f3889db2d4c2266cff17f1 100644
--- a/chrome/browser/task_manager/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -302,13 +302,10 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticePanel) {
// Open a new panel to an extension url.
GURL url(
"chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/french_sentence.html");
- Panel* panel = PanelManager::GetInstance()->CreatePanel(
+ Panel* docked_panel = PanelManager::GetInstance()->CreatePanel(
web_app::GenerateApplicationNameFromExtensionId(
last_loaded_extension_id()),
- browser()->profile(),
- url,
- nullptr,
- gfx::Rect(300, 400),
+ browser()->profile(), url, nullptr, gfx::Rect(300, 400),
PanelManager::CREATE_AS_DOCKED);
// Make sure that a task manager model created after the panel shows the
@@ -325,8 +322,30 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticePanel) {
ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
- // Close the panel and verify that we notice.
- panel->Close();
+ // 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);
afakhry 2016/05/06 23:52:02 Can you also create a panel with SHOW_AS_INACTIVE?
ncarter (slow) 2016/05/09 16:43:03 Done. I've added calls to panel->Show() / panel->S
afakhry 2016/05/09 17:35:36 Thanks!
+
+ 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,
« no previous file with comments | « chrome/browser/task_management/task_management_browsertest_util.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698