Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / task_manager / task_manager_browsertest_util.h
blob334fa268596dc801bc2cc7b5c8de67f8a4a97e12
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BROWSERTEST_UTIL_H_
6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BROWSERTEST_UTIL_H_
8 #include "base/strings/string16.h"
10 namespace task_manager {
11 namespace browsertest_util {
13 // Runs the message loop, observing the task manager, until there are exactly
14 // |resource_count| many resources whose titles match the pattern
15 // |title_pattern|. The match is done via string_util's base::MatchPattern, so
16 // |title_pattern| may contain wildcards like "*".
18 // If the wait times out, this test will trigger a gtest failure. To get
19 // meaningful errors, tests should wrap invocations of this function with
20 // ASSERT_NO_FATAL_FAILURE().
21 void WaitForTaskManagerRows(int resource_count,
22 const base::string16& title_pattern);
24 // Specifies some integer-valued column of numeric data reported by the task
25 // manager model. Please add more here as needed by tests.
26 enum ColumnSpecifier {
27 V8_MEMORY,
28 V8_MEMORY_USED,
29 SQLITE_MEMORY_USED,
31 COLUMN_NONE, // Default value.
34 // Waits for the row identified by |title_pattern| to be showing a numeric data
35 // value of at least |min_column_value| in the task manager column identified by
36 // |column_specifier|. As with WaitForTaskManagerRows(), |title_pattern| is
37 // meant to be a string returned by MatchTab() or similar.
39 // To get meaningful errors, tests should wrap invocations of this function with
40 // ASSERT_NO_FATAL_FAILURE().
41 void WaitForTaskManagerStatToExceed(const base::string16& title_pattern,
42 ColumnSpecifier column_specifier,
43 size_t min_column_value);
45 // ASCII matcher convenience functions for use with WaitForTaskManagerRows()
46 base::string16 MatchTab(const char* title); // "Tab: " + title
47 base::string16 MatchAnyTab(); // "Tab: *"
48 base::string16 MatchAboutBlankTab(); // "Tab: about:blank"
49 base::string16 MatchExtension(const char* title); // "Extension: " + title
50 base::string16 MatchAnyExtension(); // "Extension: *"
51 base::string16 MatchApp(const char* title); // "App: " + title
52 base::string16 MatchAnyApp(); // "App: *"
53 base::string16 MatchWebView(const char* title); // "WebView: " + title
54 base::string16 MatchAnyWebView(); // "WebView: *"
55 base::string16 MatchBackground(const char* title); // "Background: " + title
56 base::string16 MatchAnyBackground(); // "Background: *"
57 base::string16 MatchPrint(const char* title); // "Print: " + title
58 base::string16 MatchAnyPrint(); // "Print: *"
59 base::string16 MatchSubframe(const char* title); // "Subframe: " + title
60 base::string16 MatchAnySubframe(); // "Subframe: *"
61 // "Utility: " + title
62 base::string16 MatchUtility(const base::string16& title);
63 base::string16 MatchAnyUtility(); // "Utility: *"
65 } // namespace browsertest_util
66 } // namespace task_manager
68 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BROWSERTEST_UTIL_H_