Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1363)

Unified Diff: chrome/browser/ui/website_settings/permission_menu_model_unittest.cc

Issue 903683005: Always prompt for permission on fullscreen and mouse lock on file:// URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak unit test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/website_settings/permission_menu_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
diff --git a/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc b/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
index 8b6dfa07803cf22a12a47ba5c3c42cbd8057094c..4ddf3ca5536cf688e4a8e6b5b4a6958eda8783b8 100644
--- a/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
+++ b/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
@@ -3,10 +3,9 @@
// found in the LICENSE file.
#include "chrome/browser/ui/website_settings/permission_menu_model.h"
-#include "components/content_settings/core/common/content_settings.h"
-#include "components/content_settings/core/common/content_settings_types.h"
+#include "chrome/grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
+#include "ui/base/l10n/l10n_util.h"
namespace {
@@ -55,3 +54,25 @@ TEST(PermissionMenuModelTest, TestAllowBlock) {
callback.callback());
EXPECT_EQ(2, model.GetItemCount());
}
+
+TEST(PermissionMenuModelTest, TestFullscreenMouseLockFileUrl) {
+ TestCallback callback;
+ WebsiteSettingsUI::PermissionInfo permission;
+ permission.type = CONTENT_SETTINGS_TYPE_FULLSCREEN;
+ permission.setting = CONTENT_SETTING_ASK;
+ permission.default_setting = CONTENT_SETTING_ASK;
+ PermissionMenuModel fullscreen_model(GURL("file:///test.html"), permission,
+ callback.callback());
+ EXPECT_EQ(1, fullscreen_model.GetItemCount());
+ EXPECT_EQ(
+ l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK),
+ fullscreen_model.GetLabelAt(0));
+
+ permission.type = CONTENT_SETTINGS_TYPE_MOUSELOCK;
+ PermissionMenuModel mouselock_model(GURL("file:///test.html"), permission,
+ callback.callback());
+ EXPECT_EQ(1, mouselock_model.GetItemCount());
+ EXPECT_EQ(
+ l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK),
+ fullscreen_model.GetLabelAt(0));
+}
« no previous file with comments | « chrome/browser/ui/website_settings/permission_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698