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/printer_detector/printer_detector.h" | 5 #include "chrome/browser/chromeos/printer_detector/printer_detector.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 protected: | 96 protected: |
97 void SetExtensionSystemReady(TestingProfile* profile) { | 97 void SetExtensionSystemReady(TestingProfile* profile) { |
98 extensions::TestExtensionSystem* test_extension_system = | 98 extensions::TestExtensionSystem* test_extension_system = |
99 static_cast<extensions::TestExtensionSystem*>( | 99 static_cast<extensions::TestExtensionSystem*>( |
100 extensions::ExtensionSystem::Get(profile)); | 100 extensions::ExtensionSystem::Get(profile)); |
101 test_extension_system->SetReady(); | 101 test_extension_system->SetReady(); |
102 base::RunLoop().RunUntilIdle(); | 102 base::RunLoop().RunUntilIdle(); |
103 } | 103 } |
104 | 104 |
105 void AddTestUser() { | 105 void AddTestUser() { |
106 const user_manager::User* user = | 106 const user_manager::User* user = user_manager_->AddUser(kTestUserId); |
107 user_manager_->AddUser(AccountId::FromUserEmail(kTestUserId)); | |
108 profile_->set_profile_name(kTestUserId); | 107 profile_->set_profile_name(kTestUserId); |
109 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting( | 108 chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting( |
110 user, profile_.get()); | 109 user, profile_.get()); |
111 chromeos::PrinterDetectorFactory::GetInstance() | 110 chromeos::PrinterDetectorFactory::GetInstance() |
112 ->Get(profile_.get()) | 111 ->Get(profile_.get()) |
113 ->SetNotificationUIManagerForTesting(¬ification_ui_manager_); | 112 ->SetNotificationUIManagerForTesting(¬ification_ui_manager_); |
114 } | 113 } |
115 | 114 |
116 void InvokeUsbAdded(uint16 vendor_id, | 115 void InvokeUsbAdded(uint16 vendor_id, |
117 uint16 product_id, | 116 uint16 product_id, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 .Set("interfaceClass", kPrinterInterfaceClass)))).Pass(); | 329 .Set("interfaceClass", kPrinterInterfaceClass)))).Pass(); |
331 ASSERT_TRUE(extensions::ExtensionRegistry::Get(profile_.get()) | 330 ASSERT_TRUE(extensions::ExtensionRegistry::Get(profile_.get()) |
332 ->AddEnabled(extension)); | 331 ->AddEnabled(extension)); |
333 | 332 |
334 InvokeUsbAdded(123, 456, 1); | 333 InvokeUsbAdded(123, 456, 1); |
335 | 334 |
336 ASSERT_EQ(0u, notification_ui_manager_.GetNotificationCount()); | 335 ASSERT_EQ(0u, notification_ui_manager_.GetNotificationCount()); |
337 } | 336 } |
338 | 337 |
339 } // namespace chromeos | 338 } // namespace chromeos |
OLD | NEW |