| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_contro
ller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 // Indices of the menu items in the permission menu. | 57 // Indices of the menu items in the permission menu. |
| 58 enum PermissionMenuIndices { | 58 enum PermissionMenuIndices { |
| 59 kMenuIndexContentSettingAllow = 0, | 59 kMenuIndexContentSettingAllow = 0, |
| 60 kMenuIndexContentSettingBlock, | 60 kMenuIndexContentSettingBlock, |
| 61 kMenuIndexContentSettingDefault | 61 kMenuIndexContentSettingDefault |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 const ContentSettingsType kTestPermissionTypes[] = { | 64 const ContentSettingsType kTestPermissionTypes[] = { |
| 65 // NOTE: FULLSCREEN does not support "Always block", so it must appear as | |
| 66 // one of the first three permissions. | |
| 67 CONTENT_SETTINGS_TYPE_FULLSCREEN, | |
| 68 CONTENT_SETTINGS_TYPE_IMAGES, | 65 CONTENT_SETTINGS_TYPE_IMAGES, |
| 69 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 66 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 70 CONTENT_SETTINGS_TYPE_PLUGINS, | 67 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 71 CONTENT_SETTINGS_TYPE_POPUPS, | 68 CONTENT_SETTINGS_TYPE_POPUPS, |
| 72 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 69 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 73 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 70 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 74 CONTENT_SETTINGS_TYPE_MOUSELOCK, | |
| 75 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC | 71 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| 76 }; | 72 }; |
| 77 | 73 |
| 78 const ContentSetting kTestSettings[] = { | 74 const ContentSetting kTestSettings[] = { |
| 79 CONTENT_SETTING_DEFAULT, | 75 CONTENT_SETTING_DEFAULT, |
| 80 CONTENT_SETTING_DEFAULT, | 76 CONTENT_SETTING_DEFAULT, |
| 81 CONTENT_SETTING_DEFAULT, | |
| 82 CONTENT_SETTING_ALLOW, | 77 CONTENT_SETTING_ALLOW, |
| 83 CONTENT_SETTING_BLOCK, | 78 CONTENT_SETTING_BLOCK, |
| 84 CONTENT_SETTING_ALLOW, | 79 CONTENT_SETTING_ALLOW, |
| 85 CONTENT_SETTING_BLOCK, | 80 CONTENT_SETTING_BLOCK, |
| 86 CONTENT_SETTING_ALLOW, | |
| 87 CONTENT_SETTING_BLOCK | 81 CONTENT_SETTING_BLOCK |
| 88 }; | 82 }; |
| 89 | 83 |
| 90 const ContentSetting kTestDefaultSettings[] = { | 84 const ContentSetting kTestDefaultSettings[] = { |
| 91 CONTENT_SETTING_ALLOW, | |
| 92 CONTENT_SETTING_BLOCK, | 85 CONTENT_SETTING_BLOCK, |
| 93 CONTENT_SETTING_ASK | 86 CONTENT_SETTING_ASK |
| 94 }; | 87 }; |
| 95 | 88 |
| 96 const content_settings::SettingSource kTestSettingSources[] = { | 89 const content_settings::SettingSource kTestSettingSources[] = { |
| 97 content_settings::SETTING_SOURCE_USER, | 90 content_settings::SETTING_SOURCE_USER, |
| 98 content_settings::SETTING_SOURCE_USER, | 91 content_settings::SETTING_SOURCE_USER, |
| 99 content_settings::SETTING_SOURCE_USER, | 92 content_settings::SETTING_SOURCE_USER, |
| 100 content_settings::SETTING_SOURCE_USER, | 93 content_settings::SETTING_SOURCE_USER, |
| 101 content_settings::SETTING_SOURCE_USER, | |
| 102 content_settings::SETTING_SOURCE_POLICY, | 94 content_settings::SETTING_SOURCE_POLICY, |
| 103 content_settings::SETTING_SOURCE_POLICY, | 95 content_settings::SETTING_SOURCE_POLICY, |
| 104 content_settings::SETTING_SOURCE_EXTENSION, | |
| 105 content_settings::SETTING_SOURCE_EXTENSION | 96 content_settings::SETTING_SOURCE_EXTENSION |
| 106 }; | 97 }; |
| 107 | 98 |
| 108 class WebsiteSettingsBubbleControllerTest : public CocoaTest { | 99 class WebsiteSettingsBubbleControllerTest : public CocoaTest { |
| 109 public: | 100 public: |
| 110 WebsiteSettingsBubbleControllerTest() { | 101 WebsiteSettingsBubbleControllerTest() { |
| 111 controller_ = nil; | 102 controller_ = nil; |
| 112 } | 103 } |
| 113 | 104 |
| 114 void TearDown() override { | 105 void TearDown() override { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 315 } |
| 325 if ([view isKindOfClass:[NSPopUpButton class]]) { | 316 if ([view isKindOfClass:[NSPopUpButton class]]) { |
| 326 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); | 317 NSPopUpButton* button = static_cast<NSPopUpButton*>(view); |
| 327 EXPECT_LT(NSMaxX([button frame]), window_width); | 318 EXPECT_LT(NSMaxX([button frame]), window_width); |
| 328 } | 319 } |
| 329 } | 320 } |
| 330 } | 321 } |
| 331 } | 322 } |
| 332 | 323 |
| 333 } // namespace | 324 } // namespace |
| OLD | NEW |