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

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: style fixes and remove unused includes 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..a10bf5c31cb959be15d94632740cffd2d675a3a8 100644
--- a/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
+++ b/chrome/browser/ui/website_settings/permission_menu_model_unittest.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/strings/utf_string_conversions.h"
msw 2015/02/12 21:09:48 nit: is this actually needed?
estark 2015/02/12 21:39:15 Oops, no -- removed.
#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 +55,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_TRUE(
+ l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK)
+ .compare(fullscreen_model.GetLabelAt(0)) == 0);
msw 2015/02/12 21:09:48 nit: you should be able to use EXPECT_EQ with thes
estark 2015/02/12 21:39:15 Done.
+
+ permission.type = CONTENT_SETTINGS_TYPE_MOUSELOCK;
+ PermissionMenuModel mouselock_model(GURL("file:///test.html"), permission,
+ callback.callback());
+ EXPECT_EQ(1, mouselock_model.GetItemCount());
+ EXPECT_TRUE(
+ l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK)
+ .compare(fullscreen_model.GetLabelAt(0)) == 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