| 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 // MediaGalleriesPreferences unit tests. | 5 // MediaGalleriesPreferences unit tests. |
| 6 | 6 |
| 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" | 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public: | 54 public: |
| 55 explicit MockGalleryChangeObserver(MediaGalleriesPreferences* pref) | 55 explicit MockGalleryChangeObserver(MediaGalleriesPreferences* pref) |
| 56 : pref_(pref), | 56 : pref_(pref), |
| 57 notifications_(0) {} | 57 notifications_(0) {} |
| 58 virtual ~MockGalleryChangeObserver() {} | 58 virtual ~MockGalleryChangeObserver() {} |
| 59 | 59 |
| 60 int notifications() const { return notifications_;} | 60 int notifications() const { return notifications_;} |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // MediaGalleriesPreferences::GalleryChangeObserver implementation. | 63 // MediaGalleriesPreferences::GalleryChangeObserver implementation. |
| 64 virtual void OnGalleryChanged(MediaGalleriesPreferences* pref) OVERRIDE { | 64 virtual void OnGalleryChanged(MediaGalleriesPreferences* pref, |
| 65 const std::string& /*extension_id*/) OVERRIDE { |
| 65 EXPECT_EQ(pref_, pref); | 66 EXPECT_EQ(pref_, pref); |
| 66 ++notifications_; | 67 ++notifications_; |
| 67 } | 68 } |
| 68 | 69 |
| 69 MediaGalleriesPreferences* pref_; | 70 MediaGalleriesPreferences* pref_; |
| 70 int notifications_; | 71 int notifications_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(MockGalleryChangeObserver); | 73 DISALLOW_COPY_AND_ASSIGN(MockGalleryChangeObserver); |
| 73 }; | 74 }; |
| 74 | 75 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 expected_galleries_.erase(user_added_id); | 638 expected_galleries_.erase(user_added_id); |
| 638 expected_device_map[device_id].erase(user_added_id); | 639 expected_device_map[device_id].erase(user_added_id); |
| 639 | 640 |
| 640 EXPECT_EQ(2, observer1.notifications()); | 641 EXPECT_EQ(2, observer1.notifications()); |
| 641 EXPECT_EQ(3, observer2.notifications()); | 642 EXPECT_EQ(3, observer2.notifications()); |
| 642 } | 643 } |
| 643 | 644 |
| 644 } // namespace | 645 } // namespace |
| 645 | 646 |
| 646 } // namespace chrome | 647 } // namespace chrome |
| OLD | NEW |