| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" | 
| 6 #include "base/prefs/pref_service.h" |  | 
| 7 #include "base/prefs/testing_pref_store.h" |  | 
| 8 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_mana
    ger.h" | 6 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_mana
    ger.h" | 
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 7 #include "chrome/browser/signin/signin_manager_factory.h" | 
| 10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 8 #include "chrome/browser/sync/profile_sync_service_factory.h" | 
| 11 #include "chrome/common/extensions/api/signed_in_devices.h" | 9 #include "chrome/common/extensions/api/signed_in_devices.h" | 
| 12 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" | 
| 13 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" | 
|  | 12 #include "components/prefs/pref_service.h" | 
|  | 13 #include "components/prefs/testing_pref_store.h" | 
| 14 #include "components/signin/core/browser/signin_manager.h" | 14 #include "components/signin/core/browser/signin_manager.h" | 
| 15 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" | 
| 16 #include "extensions/browser/event_router.h" | 16 #include "extensions/browser/event_router.h" | 
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" | 
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" | 
| 19 | 19 | 
| 20 namespace extensions { | 20 namespace extensions { | 
| 21 | 21 | 
| 22 // Adds a listener and removes it. | 22 // Adds a listener and removes it. | 
| 23 TEST(SignedInDevicesManager, UpdateListener) { | 23 TEST(SignedInDevicesManager, UpdateListener) { | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 37   // Add a listener. | 37   // Add a listener. | 
| 38   manager.OnListenerAdded(info); | 38   manager.OnListenerAdded(info); | 
| 39   EXPECT_EQ(manager.change_observers_.size(), 1U); | 39   EXPECT_EQ(manager.change_observers_.size(), 1U); | 
| 40   EXPECT_EQ(manager.change_observers_[0]->extension_id(), info.extension_id); | 40   EXPECT_EQ(manager.change_observers_[0]->extension_id(), info.extension_id); | 
| 41 | 41 | 
| 42   // Remove the listener. | 42   // Remove the listener. | 
| 43   manager.OnListenerRemoved(info); | 43   manager.OnListenerRemoved(info); | 
| 44   EXPECT_TRUE(manager.change_observers_.empty()); | 44   EXPECT_TRUE(manager.change_observers_.empty()); | 
| 45 } | 45 } | 
| 46 }  // namespace extensions | 46 }  // namespace extensions | 
| OLD | NEW | 
|---|