| 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/dbus/printer_service_provider.h" | 5 #include "chrome/browser/chromeos/dbus/printer_service_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 9 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 11 #include "chrome/browser/notifications/notification.h" | 11 #include "chrome/browser/notifications/notification.h" |
| 12 #include "chrome/browser/notifications/notification_test_util.h" | 12 #include "chrome/browser/notifications/notification_test_util.h" |
| 13 #include "chrome/browser/notifications/notification_ui_manager.h" | 13 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "chromeos/chromeos_switches.h" | 15 #include "chromeos/chromeos_switches.h" |
| 16 #include "chromeos/dbus/services/service_provider_test_helper.h" | 16 #include "chromeos/dbus/services/service_provider_test_helper.h" |
| 17 #include "components/user_manager/fake_user_manager.h" | 17 #include "components/user_manager/fake_user_manager.h" |
| 18 #include "content/public/test/test_browser_thread_bundle.h" |
| 18 #include "dbus/message.h" | 19 #include "dbus/message.h" |
| 19 #include "extensions/browser/extension_registry.h" | 20 #include "extensions/browser/extension_registry.h" |
| 20 #include "extensions/common/extension_builder.h" | 21 #include "extensions/common/extension_builder.h" |
| 21 #include "extensions/common/value_builder.h" | 22 #include "extensions/common/value_builder.h" |
| 22 #include "third_party/cros_system_api/dbus/service_constants.h" | 23 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 23 | 24 |
| 24 namespace chromeos { | 25 namespace chromeos { |
| 25 | 26 |
| 26 const char kPrinterAdded[] = "PrinterAdded"; | 27 const char kPrinterAdded[] = "PrinterAdded"; |
| 27 | 28 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 .Set("app", | 124 .Set("app", |
| 124 extensions::DictionaryBuilder().Set( | 125 extensions::DictionaryBuilder().Set( |
| 125 "background", | 126 "background", |
| 126 extensions::DictionaryBuilder().Set( | 127 extensions::DictionaryBuilder().Set( |
| 127 "scripts", | 128 "scripts", |
| 128 extensions::ListBuilder().Append("bg.js")))) | 129 extensions::ListBuilder().Append("bg.js")))) |
| 129 .Set("permissions", *permissions_builder)) | 130 .Set("permissions", *permissions_builder)) |
| 130 .Build(); | 131 .Build(); |
| 131 } | 132 } |
| 132 | 133 |
| 134 content::TestBrowserThreadBundle thread_bundle_; |
| 133 StubNotificationUIManager notification_ui_manager_; | 135 StubNotificationUIManager notification_ui_manager_; |
| 134 TestingProfile profile_; | 136 TestingProfile profile_; |
| 135 user_manager::FakeUserManager* user_manager_; | 137 user_manager::FakeUserManager* user_manager_; |
| 136 chromeos::ScopedUserManagerEnabler user_manager_enabler_; | 138 chromeos::ScopedUserManagerEnabler user_manager_enabler_; |
| 137 | 139 |
| 138 MockPrinterServiceProvider service_provider_; | 140 MockPrinterServiceProvider service_provider_; |
| 139 ServiceProviderTestHelper test_helper_; | 141 ServiceProviderTestHelper test_helper_; |
| 140 | 142 |
| 141 private: | 143 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(PrinterServiceProviderAppSearchEnabledTest); | 144 DISALLOW_COPY_AND_ASSIGN(PrinterServiceProviderAppSearchEnabledTest); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 ASSERT_TRUE(response.get()); | 317 ASSERT_TRUE(response.get()); |
| 316 dbus::MessageReader reader(response.get()); | 318 dbus::MessageReader reader(response.get()); |
| 317 ASSERT_FALSE(reader.HasMoreData()); | 319 ASSERT_FALSE(reader.HasMoreData()); |
| 318 test_helper_.TearDown(); | 320 test_helper_.TearDown(); |
| 319 | 321 |
| 320 EXPECT_EQ(0u, notification_ui_manager_.GetNotificationCount()); | 322 EXPECT_EQ(0u, notification_ui_manager_.GetNotificationCount()); |
| 321 } | 323 } |
| 322 | 324 |
| 323 } // namespace chromeos | 325 } // namespace chromeos |
| 324 | 326 |
| OLD | NEW |