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

Side by Side Diff: chrome/browser/task_manager/task_manager_browsertest_util.cc

Issue 10822030: Move ui_test_utils::RunMessageLoop to test_utils so that it can be reused by content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "chrome/browser/browser_process.h" 6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/task_manager/task_manager.h" 8 #include "chrome/browser/task_manager/task_manager.h"
9 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" 9 #include "chrome/browser/task_manager/task_manager_browsertest_util.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 model->AddObserver(&observer); 59 model->AddObserver(&observer);
60 60
61 // Checks that the condition has not been satisfied yet. 61 // Checks that the condition has not been satisfied yet.
62 // This check has to be placed after the installation of the observer, 62 // This check has to be placed after the installation of the observer,
63 // because resources may change before that. 63 // because resources may change before that.
64 if (model->ResourceCount() == target_count) { 64 if (model->ResourceCount() == target_count) {
65 model->RemoveObserver(&observer); 65 model->RemoveObserver(&observer);
66 return; 66 return;
67 } 67 }
68 68
69 ui_test_utils::RunMessageLoop(); 69 content::RunMessageLoop();
70 model->RemoveObserver(&observer); 70 model->RemoveObserver(&observer);
71 } 71 }
72 72
73 // static 73 // static
74 void TaskManagerBrowserTestUtil::ShowTaskManagerAndWaitForReady( 74 void TaskManagerBrowserTestUtil::ShowTaskManagerAndWaitForReady(
75 Browser* browser) { 75 Browser* browser) {
76 #if defined(USE_AURA) 76 #if defined(USE_AURA)
77 content::WindowedNotificationObserver observer( 77 content::WindowedNotificationObserver observer(
78 chrome::NOTIFICATION_TASK_MANAGER_WINDOW_READY, 78 chrome::NOTIFICATION_TASK_MANAGER_WINDOW_READY,
79 content::Source<TaskManagerModel>(TaskManager::GetInstance()->model())); 79 content::Source<TaskManagerModel>(TaskManager::GetInstance()->model()));
80 browser->window()->ShowTaskManager(); 80 browser->window()->ShowTaskManager();
81 observer.Wait(); 81 observer.Wait();
82 #else 82 #else
83 browser->window()->ShowTaskManager(); 83 browser->window()->ShowTaskManager();
84 #endif // defined(USE_AURA) 84 #endif // defined(USE_AURA)
85 } 85 }
86 86
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698