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

Side by Side Diff: chrome/browser/policy/device_management_service_unittest.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 <ostream> 5 #include <ostream>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 protected: 49 protected:
50 DeviceManagementServiceTestBase() 50 DeviceManagementServiceTestBase()
51 : ui_thread_(BrowserThread::UI, &loop_), 51 : ui_thread_(BrowserThread::UI, &loop_),
52 io_thread_(BrowserThread::IO, &loop_) { 52 io_thread_(BrowserThread::IO, &loop_) {
53 ResetService(); 53 ResetService();
54 InitializeService(); 54 InitializeService();
55 } 55 }
56 56
57 virtual void TearDown() { 57 virtual void TearDown() {
58 service_.reset(); 58 service_.reset();
59 loop_.RunAllPending(); 59 loop_.RunUntilIdle();
60 } 60 }
61 61
62 void ResetService() { 62 void ResetService() {
63 service_.reset(new DeviceManagementService(kServiceUrl)); 63 service_.reset(new DeviceManagementService(kServiceUrl));
64 } 64 }
65 65
66 void InitializeService() { 66 void InitializeService() {
67 service_->ScheduleInitialization(0); 67 service_->ScheduleInitialization(0);
68 loop_.RunAllPending(); 68 loop_.RunUntilIdle();
69 } 69 }
70 70
71 DeviceManagementRequestJob* StartRegistrationJob() { 71 DeviceManagementRequestJob* StartRegistrationJob() {
72 DeviceManagementRequestJob* job = 72 DeviceManagementRequestJob* job =
73 service_->CreateJob(DeviceManagementRequestJob::TYPE_REGISTRATION); 73 service_->CreateJob(DeviceManagementRequestJob::TYPE_REGISTRATION);
74 job->SetGaiaToken(kGaiaAuthToken); 74 job->SetGaiaToken(kGaiaAuthToken);
75 job->SetOAuthToken(kOAuthToken); 75 job->SetOAuthToken(kOAuthToken);
76 job->SetClientID(kClientID); 76 job->SetClientID(kClientID);
77 job->GetRequest()->mutable_register_request(); 77 job->GetRequest()->mutable_register_request();
78 job->Start(base::Bind(&DeviceManagementServiceTestBase::OnJobDone, 78 job->Start(base::Bind(&DeviceManagementServiceTestBase::OnJobDone,
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 // Verify that a new URLFetcher was started that bypasses the proxy. 540 // Verify that a new URLFetcher was started that bypasses the proxy.
541 fetcher = factory_.GetFetcherByID(0); 541 fetcher = factory_.GetFetcherByID(0);
542 ASSERT_TRUE(fetcher); 542 ASSERT_TRUE(fetcher);
543 EXPECT_TRUE((fetcher->GetLoadFlags() & net::LOAD_BYPASS_PROXY) != 0); 543 EXPECT_TRUE((fetcher->GetLoadFlags() & net::LOAD_BYPASS_PROXY) != 0);
544 EXPECT_EQ(original_url, fetcher->GetOriginalURL()); 544 EXPECT_EQ(original_url, fetcher->GetOriginalURL());
545 EXPECT_EQ(upload_data, fetcher->upload_data()); 545 EXPECT_EQ(upload_data, fetcher->upload_data());
546 } 546 }
547 547
548 } // namespace policy 548 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cros_user_policy_cache_unittest.cc ('k') | chrome/browser/policy/device_status_collector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698