Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| 6 #define CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "chrome/browser/policy/device_token_fetcher.h" | |
| 12 | |
| 13 class DeviceTokenService; | |
| 14 class Profile; | |
| 15 | |
| 16 namespace policy { | |
| 17 | |
| 18 extern const char* kTestDasherDomainUsername; | |
| 19 | |
| 20 // Replacement for DeviceTokenFetcher in tests. The only difference in internal | |
| 21 // logic is that the name of the currently logged in user is not fetched from | |
| 22 // external objects, but stored internally. | |
| 23 class TestingDeviceTokenFetcher | |
| 24 : public DeviceTokenFetcher { | |
| 25 public: | |
| 26 TestingDeviceTokenFetcher( | |
| 27 DeviceManagementBackend* backend, | |
| 28 Profile* profile, | |
| 29 const FilePath& token_path) : | |
|
Mattias Nissler (ping if slow)
2010/11/23 16:00:44
Move the colon to the next line. Don't the argumen
gfeher
2010/11/24 19:38:40
No, not even on line 27.
| |
| 30 DeviceTokenFetcher(backend, profile, token_path) {} | |
| 31 | |
| 32 void SimulateLogin(const std::string& username); | |
| 33 | |
| 34 protected: | |
| 35 virtual std::string GetCurrentUser() { | |
| 36 return username_; | |
| 37 } | |
| 38 | |
| 39 private: | |
| 40 // This username will be reported as currently logged in. | |
| 41 std::string username_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(TestingDeviceTokenFetcher); | |
| 44 }; | |
| 45 | |
| 46 } // namespace policy | |
| 47 | |
| 48 #endif // CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| OLD | NEW |