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

Side by Side Diff: chrome/browser/google_apis/test_util.cc

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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 "chrome/browser/google_apis/test_util.h" 5 #include "chrome/browser/google_apis/test_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 "Couldn't find " << path.value(); 47 "Couldn't find " << path.value();
48 return path; 48 return path;
49 } 49 }
50 50
51 void RunBlockingPoolTask() { 51 void RunBlockingPoolTask() {
52 while (true) { 52 while (true) {
53 content::BrowserThread::GetBlockingPool()->FlushForTesting(); 53 content::BrowserThread::GetBlockingPool()->FlushForTesting();
54 54
55 TaskObserver task_observer; 55 TaskObserver task_observer;
56 MessageLoop::current()->AddTaskObserver(&task_observer); 56 MessageLoop::current()->AddTaskObserver(&task_observer);
57 MessageLoop::current()->RunAllPending(); 57 MessageLoop::current()->RunUntilIdle();
58 MessageLoop::current()->RemoveTaskObserver(&task_observer); 58 MessageLoop::current()->RemoveTaskObserver(&task_observer);
59 if (!task_observer.posted()) 59 if (!task_observer.posted())
60 break; 60 break;
61 } 61 }
62 } 62 }
63 63
64 64
65 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path) { 65 scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path) {
66 FilePath path = GetTestFilePath(relative_path); 66 FilePath path = GetTestFilePath(relative_path);
67 67
68 std::string error; 68 std::string error;
69 JSONFileValueSerializer serializer(path); 69 JSONFileValueSerializer serializer(path);
70 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error)); 70 scoped_ptr<base::Value> value(serializer.Deserialize(NULL, &error));
71 EXPECT_TRUE(value.get()) << 71 EXPECT_TRUE(value.get()) <<
72 "Parse error " << path.value() << ": " << error; 72 "Parse error " << path.value() << ": " << error;
73 return value.Pass(); 73 return value.Pass();
74 } 74 }
75 75
76 } // namespace test_util 76 } // namespace test_util
77 } // namespace google_apis 77 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker_unittest.cc ('k') | chrome/browser/intents/cws_intents_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698