| 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.
h" | 7 #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.
h" |
| 8 #include "chrome/browser/storage_monitor/storage_info.h" | 8 #include "chrome/browser/storage_monitor/storage_info.h" |
| 9 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" | 9 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" |
| 10 #include "chrome/common/extensions/extension_test_util.h" | |
| 11 #include "extensions/common/extension.h" | 10 #include "extensions/common/extension.h" |
| 11 #include "extensions/common/test_util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using ::testing::_; | 14 using ::testing::_; |
| 15 using ::testing::NiceMock; | 15 using ::testing::NiceMock; |
| 16 using ::testing::Return; | 16 using ::testing::Return; |
| 17 using ::testing::ReturnPointee; | 17 using ::testing::ReturnPointee; |
| 18 using ::testing::ReturnRef; | 18 using ::testing::ReturnRef; |
| 19 | 19 |
| 20 MediaGalleryPrefInfo MakePrefInfoForTesting(MediaGalleryPrefId pref_id) { | 20 MediaGalleryPrefInfo MakePrefInfoForTesting(MediaGalleryPrefId pref_id) { |
| 21 MediaGalleryPrefInfo gallery; | 21 MediaGalleryPrefInfo gallery; |
| 22 gallery.pref_id = pref_id; | 22 gallery.pref_id = pref_id; |
| 23 gallery.device_id = | 23 gallery.device_id = |
| 24 StorageInfo::MakeDeviceId(StorageInfo::FIXED_MASS_STORAGE, | 24 StorageInfo::MakeDeviceId(StorageInfo::FIXED_MASS_STORAGE, |
| 25 base::Int64ToString(pref_id)); | 25 base::Int64ToString(pref_id)); |
| 26 gallery.display_name = base::ASCIIToUTF16("name"); | 26 gallery.display_name = base::ASCIIToUTF16("name"); |
| 27 return gallery; | 27 return gallery; |
| 28 } | 28 } |
| 29 | 29 |
| 30 class MediaGalleriesDialogTest : public testing::Test { | 30 class MediaGalleriesDialogTest : public testing::Test { |
| 31 public: | 31 public: |
| 32 MediaGalleriesDialogTest() {} | 32 MediaGalleriesDialogTest() {} |
| 33 virtual ~MediaGalleriesDialogTest() {} | 33 virtual ~MediaGalleriesDialogTest() {} |
| 34 virtual void SetUp() OVERRIDE { | 34 virtual void SetUp() OVERRIDE { |
| 35 dummy_extension_ = extension_test_util::CreateExtensionWithID("dummy"); | 35 dummy_extension_ = extensions::test_util::CreateExtensionWithID("dummy"); |
| 36 } | 36 } |
| 37 virtual void TearDown() OVERRIDE { | 37 virtual void TearDown() OVERRIDE { |
| 38 dummy_extension_ = NULL; | 38 dummy_extension_ = NULL; |
| 39 } | 39 } |
| 40 | 40 |
| 41 const extensions::Extension& dummy_extension() const { | 41 const extensions::Extension& dummy_extension() const { |
| 42 return *dummy_extension_; | 42 return *dummy_extension_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 // Remove a gallery. | 200 // Remove a gallery. |
| 201 attached_permissions.erase(attached_permissions.begin()); | 201 attached_permissions.erase(attached_permissions.begin()); |
| 202 dialog->UpdateGalleries(); | 202 dialog->UpdateGalleries(); |
| 203 EXPECT_EQ(1U, [dialog->checkboxes_ count]); | 203 EXPECT_EQ(1U, [dialog->checkboxes_ count]); |
| 204 | 204 |
| 205 // The checkbox container should be shorter. | 205 // The checkbox container should be shorter. |
| 206 CGFloat new_container_height = NSHeight([dialog->checkbox_container_ frame]); | 206 CGFloat new_container_height = NSHeight([dialog->checkbox_container_ frame]); |
| 207 EXPECT_LT(new_container_height, old_container_height); | 207 EXPECT_LT(new_container_height, old_container_height); |
| 208 } | 208 } |
| OLD | NEW |