| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/task_manager/task_manager_browsertest_util.h" | 5 #include "chrome/browser/task_management/task_manager_browsertest_util.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/strings/pattern.h" | 12 #include "base/strings/pattern.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/test/test_timeouts.h" | 16 #include "base/test/test_timeouts.h" |
| 17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| 18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/task_management/task_manager_tester.h" | 20 #include "chrome/browser/task_management/task_manager_tester.h" |
| 21 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
| 22 #include "extensions/strings/grit/extensions_strings.h" | 22 #include "extensions/strings/grit/extensions_strings.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/models/table_model_observer.h" | 25 #include "ui/base/models/table_model_observer.h" |
| 26 | 26 |
| 27 namespace task_manager { | 27 namespace task_management { |
| 28 namespace browsertest_util { | 28 namespace browsertest_util { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 using TaskManagerTester = task_management::TaskManagerTester; | |
| 33 | |
| 34 // Helper class to run a message loop until a TaskManagerTester is in an | 32 // Helper class to run a message loop until a TaskManagerTester is in an |
| 35 // expected state. If timeout occurs, an ASCII version of the task manager's | 33 // expected state. If timeout occurs, an ASCII version of the task manager's |
| 36 // contents, along with a summary of the expected state, are dumped to test | 34 // contents, along with a summary of the expected state, are dumped to test |
| 37 // output, to assist debugging. | 35 // output, to assist debugging. |
| 38 class ResourceChangeObserver { | 36 class ResourceChangeObserver { |
| 39 public: | 37 public: |
| 40 ResourceChangeObserver(int required_count, | 38 ResourceChangeObserver(int required_count, |
| 41 const base::string16& title_pattern, | 39 const base::string16& title_pattern, |
| 42 ColumnSpecifier column_specifier, | 40 ColumnSpecifier column_specifier, |
| 43 size_t min_column_value) | 41 size_t min_column_value) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 244 |
| 247 base::string16 MatchUtility(const base::string16& title) { | 245 base::string16 MatchUtility(const base::string16& title) { |
| 248 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX, title); | 246 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX, title); |
| 249 } | 247 } |
| 250 | 248 |
| 251 base::string16 MatchAnyUtility() { | 249 base::string16 MatchAnyUtility() { |
| 252 return MatchUtility(base::ASCIIToUTF16("*")); | 250 return MatchUtility(base::ASCIIToUTF16("*")); |
| 253 } | 251 } |
| 254 | 252 |
| 255 } // namespace browsertest_util | 253 } // namespace browsertest_util |
| 256 } // namespace task_manager | 254 } // namespace task_management |
| OLD | NEW |