OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/signin/easy_unlock_app_manager.h" | 5 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 public: | 284 public: |
285 EasyUnlockAppManagerTest() | 285 EasyUnlockAppManagerTest() |
286 : event_consumer_(&profile_), | 286 : event_consumer_(&profile_), |
287 command_line_(base::CommandLine::NO_PROGRAM) {} | 287 command_line_(base::CommandLine::NO_PROGRAM) {} |
288 ~EasyUnlockAppManagerTest() override {} | 288 ~EasyUnlockAppManagerTest() override {} |
289 | 289 |
290 void SetUp() override { | 290 void SetUp() override { |
291 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 291 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
292 proximity_auth::switches::kForceLoadEasyUnlockAppInTests); | 292 proximity_auth::switches::kForceLoadEasyUnlockAppInTests); |
293 extensions::ExtensionSystem* extension_system = SetUpExtensionSystem(); | 293 extensions::ExtensionSystem* extension_system = SetUpExtensionSystem(); |
294 app_manager_ = | 294 app_manager_ = EasyUnlockAppManager::Create( |
295 EasyUnlockAppManager::Create(extension_system, IDR_EASY_UNLOCK_MANIFEST, | 295 extension_system, IDR_EASY_UNLOCK_MANIFEST, GetAppPath()); |
296 GetAppPath()).Pass(); | |
297 } | 296 } |
298 | 297 |
299 protected: | 298 protected: |
300 void SetExtensionSystemReady() { | 299 void SetExtensionSystemReady() { |
301 extensions::TestExtensionSystem* test_extension_system = | 300 extensions::TestExtensionSystem* test_extension_system = |
302 static_cast<extensions::TestExtensionSystem*>( | 301 static_cast<extensions::TestExtensionSystem*>( |
303 extensions::ExtensionSystem::Get(&profile_)); | 302 extensions::ExtensionSystem::Get(&profile_)); |
304 test_extension_system->SetReady(); | 303 test_extension_system->SetReady(); |
305 base::RunLoop().RunUntilIdle(); | 304 base::RunLoop().RunUntilIdle(); |
306 } | 305 } |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 extension_misc::kEasyUnlockAppId); | 634 extension_misc::kEasyUnlockAppId); |
636 app_manager_->DisableAppIfLoaded(); | 635 app_manager_->DisableAppIfLoaded(); |
637 | 636 |
638 ASSERT_EQ(0u, event_consumer_.auth_attempted_count()); | 637 ASSERT_EQ(0u, event_consumer_.auth_attempted_count()); |
639 | 638 |
640 EXPECT_FALSE(app_manager_->SendAuthAttemptEvent()); | 639 EXPECT_FALSE(app_manager_->SendAuthAttemptEvent()); |
641 EXPECT_EQ(0u, event_consumer_.auth_attempted_count()); | 640 EXPECT_EQ(0u, event_consumer_.auth_attempted_count()); |
642 } | 641 } |
643 | 642 |
644 } // namespace | 643 } // namespace |
OLD | NEW |