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

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller_browsertest.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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
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/login/wizard_controller.h" 5 #include "chrome/browser/chromeos/login/wizard_controller.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 // Check that output is unmuted now and at some level. 369 // Check that output is unmuted now and at some level.
370 CrasAudioHandler* cras = CrasAudioHandler::Get(); 370 CrasAudioHandler* cras = CrasAudioHandler::Get();
371 ASSERT_FALSE(cras->IsOutputMuted()); 371 ASSERT_FALSE(cras->IsOutputMuted());
372 ASSERT_EQ(WizardController::kMinAudibleOutputVolumePercent, 372 ASSERT_EQ(WizardController::kMinAudibleOutputVolumePercent,
373 cras->GetOutputVolumePercent()); 373 cras->GetOutputVolumePercent());
374 } 374 }
375 375
376 class WizardControllerTestURLFetcherFactory 376 class WizardControllerTestURLFetcherFactory
377 : public net::TestURLFetcherFactory { 377 : public net::TestURLFetcherFactory {
378 public: 378 public:
379 net::URLFetcher* CreateURLFetcher(int id, 379 scoped_ptr<net::URLFetcher> CreateURLFetcher(
380 const GURL& url, 380 int id,
381 net::URLFetcher::RequestType request_type, 381 const GURL& url,
382 net::URLFetcherDelegate* d) override { 382 net::URLFetcher::RequestType request_type,
383 net::URLFetcherDelegate* d) override {
383 if (StartsWithASCII( 384 if (StartsWithASCII(
384 url.spec(), 385 url.spec(),
385 SimpleGeolocationProvider::DefaultGeolocationProviderURL().spec(), 386 SimpleGeolocationProvider::DefaultGeolocationProviderURL().spec(),
386 true)) { 387 true)) {
387 return new net::FakeURLFetcher(url, 388 return scoped_ptr<net::URLFetcher>(new net::FakeURLFetcher(
388 d, 389 url, d, std::string(kGeolocationResponseBody), net::HTTP_OK,
389 std::string(kGeolocationResponseBody), 390 net::URLRequestStatus::SUCCESS));
390 net::HTTP_OK,
391 net::URLRequestStatus::SUCCESS);
392 } 391 }
393 if (StartsWithASCII(url.spec(), 392 if (StartsWithASCII(url.spec(),
394 chromeos::DefaultTimezoneProviderURL().spec(), 393 chromeos::DefaultTimezoneProviderURL().spec(),
395 true)) { 394 true)) {
396 return new net::FakeURLFetcher(url, 395 return scoped_ptr<net::URLFetcher>(new net::FakeURLFetcher(
397 d, 396 url, d, std::string(kTimezoneResponseBody), net::HTTP_OK,
398 std::string(kTimezoneResponseBody), 397 net::URLRequestStatus::SUCCESS));
399 net::HTTP_OK,
400 net::URLRequestStatus::SUCCESS);
401 } 398 }
402 return net::TestURLFetcherFactory::CreateURLFetcher( 399 return net::TestURLFetcherFactory::CreateURLFetcher(
403 id, url, request_type, d); 400 id, url, request_type, d);
404 } 401 }
405 ~WizardControllerTestURLFetcherFactory() override {} 402 ~WizardControllerTestURLFetcherFactory() override {}
406 }; 403 };
407 404
408 class TimeZoneTestRunner { 405 class TimeZoneTestRunner {
409 public: 406 public:
410 void OnResolved() { loop_.Quit(); } 407 void OnResolved() { loop_.Quit(); }
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when 1258 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when
1262 // UI and logic is ready. http://crbug.com/127016 1259 // UI and logic is ready. http://crbug.com/127016
1263 1260
1264 // TODO(dzhioev): Add tests for controller/host pairing flow. 1261 // TODO(dzhioev): Add tests for controller/host pairing flow.
1265 // http://crbug.com/375191 1262 // http://crbug.com/375191
1266 1263
1267 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 24, 1264 static_assert(BaseScreenDelegate::EXIT_CODES_COUNT == 24,
1268 "tests for new control flow are missing"); 1265 "tests for new control flow are missing");
1269 1266
1270 } // namespace chromeos 1267 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698