Chromium Code Reviews

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc

Issue 1220963005: Update base::StartsWith calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 194 matching lines...)
205 } 205 }
206 206
207 // Expects a pending URLFetcher for the |expected_url|, and returns it with 207 // Expects a pending URLFetcher for the |expected_url|, and returns it with
208 // prepared to deliver a response to its delegate. 208 // prepared to deliver a response to its delegate.
209 net::TestURLFetcher* PrepareOAuthFetcher(const GURL& expected_url) { 209 net::TestURLFetcher* PrepareOAuthFetcher(const GURL& expected_url) {
210 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0); 210 net::TestURLFetcher* fetcher = test_url_fetcher_factory_.GetFetcherByID(0);
211 EXPECT_TRUE(fetcher); 211 EXPECT_TRUE(fetcher);
212 if (!fetcher) 212 if (!fetcher)
213 return NULL; 213 return NULL;
214 EXPECT_TRUE(fetcher->delegate()); 214 EXPECT_TRUE(fetcher->delegate());
215 EXPECT_TRUE(base::StartsWithASCII(fetcher->GetOriginalURL().spec(), 215 EXPECT_TRUE(base::StartsWith(fetcher->GetOriginalURL().spec(),
216 expected_url.spec(), true)); 216 expected_url.spec(),
217 base::CompareCase::SENSITIVE));
217 fetcher->set_url(fetcher->GetOriginalURL()); 218 fetcher->set_url(fetcher->GetOriginalURL());
218 fetcher->set_response_code(200); 219 fetcher->set_response_code(200);
219 fetcher->set_status(net::URLRequestStatus()); 220 fetcher->set_status(net::URLRequestStatus());
220 return fetcher; 221 return fetcher;
221 } 222 }
222 223
223 // Issues the OAuth2 tokens and returns the device management register job 224 // Issues the OAuth2 tokens and returns the device management register job
224 // if the flow succeeded. 225 // if the flow succeeded.
225 MockDeviceManagementJob* IssueOAuthToken(bool has_request_token) { 226 MockDeviceManagementJob* IssueOAuthToken(bool has_request_token) {
226 EXPECT_FALSE(manager_->core()->client()->is_registered()); 227 EXPECT_FALSE(manager_->core()->client()->is_registered());
(...skipping 361 matching lines...)
588 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); 589 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME));
589 EXPECT_TRUE(manager_->core()->client()->is_registered()); 590 EXPECT_TRUE(manager_->core()->client()->is_registered());
590 591
591 // The refresh scheduler takes care of the initial fetch for unmanaged users. 592 // The refresh scheduler takes care of the initial fetch for unmanaged users.
592 // Running the task runner issues the initial fetch. 593 // Running the task runner issues the initial fetch.
593 FetchPolicy( 594 FetchPolicy(
594 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); 595 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_));
595 } 596 }
596 597
597 } // namespace policy 598 } // namespace policy
OLDNEW

Powered by Google App Engine