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

Side by Side Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 1293813005: Change the new-task-manager flag so that the new implementation is enabled by default for all users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <queue> 5 #include <queue>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/process/process.h" 9 #include "base/process/process.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 PrerenderLinkManager* prerender_link_manager = 1367 PrerenderLinkManager* prerender_link_manager =
1368 PrerenderLinkManagerFactory::GetForProfile( 1368 PrerenderLinkManagerFactory::GetForProfile(
1369 Profile::FromBrowserContext(guest_web_contents->GetBrowserContext())); 1369 Profile::FromBrowserContext(guest_web_contents->GetBrowserContext()));
1370 ASSERT_TRUE(prerender_link_manager != NULL); 1370 ASSERT_TRUE(prerender_link_manager != NULL);
1371 EXPECT_TRUE(prerender_link_manager->IsEmpty()); 1371 EXPECT_TRUE(prerender_link_manager->IsEmpty());
1372 } 1372 }
1373 1373
1374 // Verify that existing <webview>'s are detected when the task manager starts 1374 // Verify that existing <webview>'s are detected when the task manager starts
1375 // up. 1375 // up.
1376 IN_PROC_BROWSER_TEST_F(WebViewTest, TaskManagerExistingWebView) { 1376 IN_PROC_BROWSER_TEST_F(WebViewTest, TaskManagerExistingWebView) {
1377 // This test is for the old implementation of the task manager. We must
1378 // explicitly disable the new one.
1379 task_manager::browsertest_util::EnableOldTaskManager();
1380
1377 ASSERT_TRUE(StartEmbeddedTestServer()); 1381 ASSERT_TRUE(StartEmbeddedTestServer());
1378 1382
1379 LoadGuest("/extensions/platform_apps/web_view/task_manager/guest.html", 1383 LoadGuest("/extensions/platform_apps/web_view/task_manager/guest.html",
1380 "web_view/task_manager"); 1384 "web_view/task_manager");
1381 1385
1382 chrome::ShowTaskManager(browser()); // Show task manager AFTER guest loads. 1386 chrome::ShowTaskManager(browser()); // Show task manager AFTER guest loads.
1383 1387
1384 const char* guest_title = "WebViewed test content"; 1388 const char* guest_title = "WebViewed test content";
1385 const char* app_name = "<webview> task manager test"; 1389 const char* app_name = "<webview> task manager test";
1386 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchWebView(guest_title))); 1390 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchWebView(guest_title)));
1387 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab())); 1391 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAboutBlankTab()));
1388 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchApp(app_name))); 1392 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchApp(app_name)));
1389 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchBackground(app_name))); 1393 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchBackground(app_name)));
1390 1394
1391 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyWebView())); 1395 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyWebView()));
1392 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); 1396 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab()));
1393 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyApp())); 1397 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyApp()));
1394 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyBackground())); 1398 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyBackground()));
1395 } 1399 }
1396 1400
1397 // Verify that the task manager notices the creation of new <webview>'s. 1401 // Verify that the task manager notices the creation of new <webview>'s.
1398 IN_PROC_BROWSER_TEST_F(WebViewTest, TaskManagerNewWebView) { 1402 IN_PROC_BROWSER_TEST_F(WebViewTest, TaskManagerNewWebView) {
1403 // This test is for the old implementation of the task manager. We must
1404 // explicitly disable the new one.
1405 task_manager::browsertest_util::EnableOldTaskManager();
1406
1399 ASSERT_TRUE(StartEmbeddedTestServer()); 1407 ASSERT_TRUE(StartEmbeddedTestServer());
1400 1408
1401 chrome::ShowTaskManager(browser()); // Show task manager BEFORE guest loads. 1409 chrome::ShowTaskManager(browser()); // Show task manager BEFORE guest loads.
1402 1410
1403 LoadGuest("/extensions/platform_apps/web_view/task_manager/guest.html", 1411 LoadGuest("/extensions/platform_apps/web_view/task_manager/guest.html",
1404 "web_view/task_manager"); 1412 "web_view/task_manager");
1405 1413
1406 const char* guest_title = "WebViewed test content"; 1414 const char* guest_title = "WebViewed test content";
1407 const char* app_name = "<webview> task manager test"; 1415 const char* app_name = "<webview> task manager test";
1408 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchWebView(guest_title))); 1416 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchWebView(guest_title)));
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2726 const task_management::Task* task = task_manager.tasks().back(); 2734 const task_management::Task* task = task_manager.tasks().back();
2727 EXPECT_EQ(task_management::Task::GUEST, task->GetType()); 2735 EXPECT_EQ(task_management::Task::GUEST, task->GetType());
2728 const base::string16 title = task->title(); 2736 const base::string16 title = task->title();
2729 const base::string16 expected_prefix = GetExpectedPrefix(guest_contents); 2737 const base::string16 expected_prefix = GetExpectedPrefix(guest_contents);
2730 EXPECT_TRUE(base::StartsWith(title, 2738 EXPECT_TRUE(base::StartsWith(title,
2731 expected_prefix, 2739 expected_prefix,
2732 base::CompareCase::INSENSITIVE_ASCII)); 2740 base::CompareCase::INSENSITIVE_ASCII));
2733 } 2741 }
2734 2742
2735 #endif // defined(ENABLE_TASK_MANAGER) 2743 #endif // defined(ENABLE_TASK_MANAGER)
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/extensions/api/processes/processes_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698