| OLD | NEW |
| 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 "ash/accessibility_types.h" | 7 #include "ash/accessibility_types.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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "chromeos/timezone/timezone_request.h" | 65 #include "chromeos/timezone/timezone_request.h" |
| 66 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 66 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 67 #include "components/prefs/pref_registry_simple.h" | 67 #include "components/prefs/pref_registry_simple.h" |
| 68 #include "components/prefs/pref_service.h" | 68 #include "components/prefs/pref_service.h" |
| 69 #include "components/prefs/pref_service_factory.h" | 69 #include "components/prefs/pref_service_factory.h" |
| 70 #include "components/prefs/testing_pref_store.h" | 70 #include "components/prefs/testing_pref_store.h" |
| 71 #include "content/public/common/content_switches.h" | 71 #include "content/public/common/content_switches.h" |
| 72 #include "content/public/test/browser_test_utils.h" | 72 #include "content/public/test/browser_test_utils.h" |
| 73 #include "content/public/test/test_utils.h" | 73 #include "content/public/test/test_utils.h" |
| 74 #include "net/test/spawned_test_server/spawned_test_server.h" | 74 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 75 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
| 75 #include "net/url_request/test_url_fetcher_factory.h" | 76 #include "net/url_request/test_url_fetcher_factory.h" |
| 76 #include "net/url_request/url_fetcher_impl.h" | 77 #include "net/url_request/url_fetcher_impl.h" |
| 77 #include "testing/gmock/include/gmock/gmock.h" | 78 #include "testing/gmock/include/gmock/gmock.h" |
| 78 #include "testing/gtest/include/gtest/gtest.h" | 79 #include "testing/gtest/include/gtest/gtest.h" |
| 79 #include "third_party/icu/source/common/unicode/locid.h" | 80 #include "third_party/icu/source/common/unicode/locid.h" |
| 80 #include "ui/base/accelerators/accelerator.h" | 81 #include "ui/base/accelerators/accelerator.h" |
| 81 #include "ui/base/l10n/l10n_util.h" | 82 #include "ui/base/l10n/l10n_util.h" |
| 82 | 83 |
| 83 using ::testing::Exactly; | 84 using ::testing::Exactly; |
| 84 using ::testing::Invoke; | 85 using ::testing::Invoke; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 cras->GetOutputVolumePercent()); | 359 cras->GetOutputVolumePercent()); |
| 359 } | 360 } |
| 360 | 361 |
| 361 class WizardControllerTestURLFetcherFactory | 362 class WizardControllerTestURLFetcherFactory |
| 362 : public net::TestURLFetcherFactory { | 363 : public net::TestURLFetcherFactory { |
| 363 public: | 364 public: |
| 364 std::unique_ptr<net::URLFetcher> CreateURLFetcher( | 365 std::unique_ptr<net::URLFetcher> CreateURLFetcher( |
| 365 int id, | 366 int id, |
| 366 const GURL& url, | 367 const GURL& url, |
| 367 net::URLFetcher::RequestType request_type, | 368 net::URLFetcher::RequestType request_type, |
| 368 net::URLFetcherDelegate* d) override { | 369 net::URLFetcherDelegate* d, |
| 370 net::NetworkTrafficAnnotationTag traffic_annotation) override { |
| 369 if (base::StartsWith( | 371 if (base::StartsWith( |
| 370 url.spec(), | 372 url.spec(), |
| 371 SimpleGeolocationProvider::DefaultGeolocationProviderURL().spec(), | 373 SimpleGeolocationProvider::DefaultGeolocationProviderURL().spec(), |
| 372 base::CompareCase::SENSITIVE)) { | 374 base::CompareCase::SENSITIVE)) { |
| 373 return std::unique_ptr<net::URLFetcher>(new net::FakeURLFetcher( | 375 return std::unique_ptr<net::URLFetcher>(new net::FakeURLFetcher( |
| 374 url, d, std::string(kGeolocationResponseBody), net::HTTP_OK, | 376 url, d, std::string(kGeolocationResponseBody), net::HTTP_OK, |
| 375 net::URLRequestStatus::SUCCESS)); | 377 net::URLRequestStatus::SUCCESS)); |
| 376 } | 378 } |
| 377 if (base::StartsWith(url.spec(), | 379 if (base::StartsWith(url.spec(), |
| 378 chromeos::DefaultTimezoneProviderURL().spec(), | 380 chromeos::DefaultTimezoneProviderURL().spec(), |
| 379 base::CompareCase::SENSITIVE)) { | 381 base::CompareCase::SENSITIVE)) { |
| 380 return std::unique_ptr<net::URLFetcher>(new net::FakeURLFetcher( | 382 return std::unique_ptr<net::URLFetcher>(new net::FakeURLFetcher( |
| 381 url, d, std::string(kTimezoneResponseBody), net::HTTP_OK, | 383 url, d, std::string(kTimezoneResponseBody), net::HTTP_OK, |
| 382 net::URLRequestStatus::SUCCESS)); | 384 net::URLRequestStatus::SUCCESS)); |
| 383 } | 385 } |
| 384 return net::TestURLFetcherFactory::CreateURLFetcher( | 386 return net::TestURLFetcherFactory::CreateURLFetcher(id, url, request_type, |
| 385 id, url, request_type, d); | 387 d, traffic_annotation); |
| 386 } | 388 } |
| 387 ~WizardControllerTestURLFetcherFactory() override {} | 389 ~WizardControllerTestURLFetcherFactory() override {} |
| 388 }; | 390 }; |
| 389 | 391 |
| 390 class TimeZoneTestRunner { | 392 class TimeZoneTestRunner { |
| 391 public: | 393 public: |
| 392 void OnResolved() { loop_.Quit(); } | 394 void OnResolved() { loop_.Quit(); } |
| 393 void Run() { loop_.Run(); } | 395 void Run() { loop_.Run(); } |
| 394 | 396 |
| 395 private: | 397 private: |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 | 1344 |
| 1343 // TODO(khmel): Add tests for ARC OptIn flow. | 1345 // TODO(khmel): Add tests for ARC OptIn flow. |
| 1344 // http://crbug.com/651144 | 1346 // http://crbug.com/651144 |
| 1345 | 1347 |
| 1346 // TODO(fukino): Add tests for encryption migration UI. | 1348 // TODO(fukino): Add tests for encryption migration UI. |
| 1347 // http://crbug.com/706017 | 1349 // http://crbug.com/706017 |
| 1348 static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 27, | 1350 static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 27, |
| 1349 "tests for new control flow are missing"); | 1351 "tests for new control flow are missing"); |
| 1350 | 1352 |
| 1351 } // namespace chromeos | 1353 } // namespace chromeos |
| OLD | NEW |