| 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/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" | 8 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" |
| 9 #include "components/storage_monitor/storage_info.h" | 9 #include "components/storage_monitor/storage_info.h" |
| 10 #include "extensions/common/extension.h" | 10 #include "extensions/common/extension.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 base::Int64ToString(pref_id)); | 45 base::Int64ToString(pref_id)); |
| 46 gallery.display_name = base::ASCIIToUTF16("name"); | 46 gallery.display_name = base::ASCIIToUTF16("name"); |
| 47 return gallery; | 47 return gallery; |
| 48 } | 48 } |
| 49 | 49 |
| 50 class MediaGalleriesDialogTest : public testing::Test { | 50 class MediaGalleriesDialogTest : public testing::Test { |
| 51 public: | 51 public: |
| 52 MediaGalleriesDialogTest() {} | 52 MediaGalleriesDialogTest() {} |
| 53 virtual ~MediaGalleriesDialogTest() {} | 53 virtual ~MediaGalleriesDialogTest() {} |
| 54 | 54 |
| 55 virtual void SetUp() OVERRIDE { | 55 virtual void SetUp() override { |
| 56 std::vector<base::string16> headers; | 56 std::vector<base::string16> headers; |
| 57 headers.push_back(base::string16()); | 57 headers.push_back(base::string16()); |
| 58 headers.push_back(base::ASCIIToUTF16("header2")); | 58 headers.push_back(base::ASCIIToUTF16("header2")); |
| 59 ON_CALL(controller_, GetSectionHeaders()). | 59 ON_CALL(controller_, GetSectionHeaders()). |
| 60 WillByDefault(Return(headers)); | 60 WillByDefault(Return(headers)); |
| 61 EXPECT_CALL(controller_, GetSectionEntries(_)). | 61 EXPECT_CALL(controller_, GetSectionEntries(_)). |
| 62 Times(AnyNumber()); | 62 Times(AnyNumber()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual void TearDown() OVERRIDE { | 65 virtual void TearDown() override { |
| 66 Mock::VerifyAndClearExpectations(&controller_); | 66 Mock::VerifyAndClearExpectations(&controller_); |
| 67 dialog_.reset(); | 67 dialog_.reset(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 NiceMock<MediaGalleriesDialogControllerMock>* controller() { | 70 NiceMock<MediaGalleriesDialogControllerMock>* controller() { |
| 71 return &controller_; | 71 return &controller_; |
| 72 } | 72 } |
| 73 | 73 |
| 74 MediaGalleriesDialogCocoa* GetOrCreateDialog() { | 74 MediaGalleriesDialogCocoa* GetOrCreateDialog() { |
| 75 if (!dialog_.get()) { | 75 if (!dialog_.get()) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // Remove a gallery. | 200 // Remove a gallery. |
| 201 attached_permissions.erase(attached_permissions.begin()); | 201 attached_permissions.erase(attached_permissions.begin()); |
| 202 GetOrCreateDialog()->UpdateGalleries(); | 202 GetOrCreateDialog()->UpdateGalleries(); |
| 203 EXPECT_EQ(1U, [[GetOrCreateDialog()->checkbox_container_ subviews] count]); | 203 EXPECT_EQ(1U, [[GetOrCreateDialog()->checkbox_container_ subviews] count]); |
| 204 | 204 |
| 205 // The checkbox container should be shorter. | 205 // The checkbox container should be shorter. |
| 206 CGFloat new_container_height = | 206 CGFloat new_container_height = |
| 207 NSHeight([GetOrCreateDialog()->checkbox_container_ frame]); | 207 NSHeight([GetOrCreateDialog()->checkbox_container_ frame]); |
| 208 EXPECT_LT(new_container_height, old_container_height); | 208 EXPECT_LT(new_container_height, old_container_height); |
| 209 } | 209 } |
| OLD | NEW |