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

Unified Diff: chrome/browser/instant/instant_browsertest.cc

Issue 8759009: Add "Instant:" prefix to Instant preview tabs in the Task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cache is_instant_preview Created 9 years, 1 month 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/app/generated_resources.grd ('k') | chrome/browser/task_manager/task_manager_resource_providers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index a8859dd44fb3e8c58309759cd762f2bc9c299726..96ad8e37f43731aca348a01a1789783955142c63 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/command_line.h"
+#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
@@ -14,6 +15,8 @@
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
+#include "chrome/browser/task_manager/task_manager.h"
+#include "chrome/browser/task_manager/task_manager_browsertest_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
@@ -29,6 +32,8 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/notification_service.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
// Tests are flaky on Linux because of http://crbug.com/80118.
#if defined(OS_LINUX)
@@ -802,6 +807,28 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(PageVisibilityTest)) {
ASSERT_TRUE(CheckVisibilityIs(preview_contents, true));
}
+// Tests that the task manager identifies instant's preview tab correctly.
+IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(TaskManagerPrefix)) {
+ // The browser starts with one new tab, so the task manager should have two
+ // rows initially, one for the browser process and one for tab's renderer.
+ TaskManagerModel* task_manager = TaskManager::GetInstance()->model();
+ task_manager->StartUpdating();
+ TaskManagerBrowserTestUtil::WaitForResourceChange(2);
+
+ ASSERT_TRUE(test_server()->Start());
+ EnableInstant();
+ SetupInstantProvider("instant.html");
+ DetermineInstantSupport();
+ SearchAndWaitForPreviewToShow();
+
+ // Now there should be three rows, the third being the instant preview.
+ TaskManagerBrowserTestUtil::WaitForResourceChange(3);
+ string16 prefix = l10n_util::GetStringFUTF16(
+ IDS_TASK_MANAGER_INSTANT_PREVIEW_PREFIX, string16());
+ string16 title = task_manager->GetResourceTitle(2);
+ EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix;
+}
+
// Tests the INSTANT experiment of the field trial.
class InstantFieldTrialInstantTest : public InstantTest {
public:
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/task_manager/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698