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

Side by Side 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: Updated Mac UI for fullscreen on file:// URLs 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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/website_settings/permission_menu_model.h" 5 #include "chrome/browser/ui/website_settings/permission_menu_model.h"
6 #include "components/content_settings/core/common/content_settings.h" 6 #include "components/content_settings/core/common/content_settings.h"
7 #include "components/content_settings/core/common/content_settings_types.h" 7 #include "components/content_settings/core/common/content_settings_types.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 EXPECT_EQ(2, model.GetItemCount()); 48 EXPECT_EQ(2, model.GetItemCount());
49 } 49 }
50 50
51 TEST(PermissionMenuModelTest, TestAllowBlock) { 51 TEST(PermissionMenuModelTest, TestAllowBlock) {
52 TestCallback callback; 52 TestCallback callback;
53 PermissionMenuModel model(GURL("http://www.google.com"), 53 PermissionMenuModel model(GURL("http://www.google.com"),
54 CONTENT_SETTING_ALLOW, 54 CONTENT_SETTING_ALLOW,
55 callback.callback()); 55 callback.callback());
56 EXPECT_EQ(2, model.GetItemCount()); 56 EXPECT_EQ(2, model.GetItemCount());
57 } 57 }
58
59 TEST(PermissionMenuModelTest, TestFullscreenMouseLockFileUrl) {
60 TestCallback callback;
61 WebsiteSettingsUI::PermissionInfo permission;
62 permission.type = CONTENT_SETTINGS_TYPE_FULLSCREEN;
63 permission.setting = CONTENT_SETTING_ASK;
64 permission.default_setting = CONTENT_SETTING_ASK;
65 PermissionMenuModel fullscreen_model(GURL("file:///test.html"), permission,
66 callback.callback());
67 EXPECT_EQ(1, fullscreen_model.GetItemCount());
msw 2015/02/12 00:07:59 nit: Maybe check GetCommandIdAt(0) or GetLabelAt(0
estark 2015/02/12 02:33:10 Done.
68
69 permission.type = CONTENT_SETTINGS_TYPE_MOUSELOCK;
70 PermissionMenuModel mouselock_model(GURL("file:///test.html"), permission,
71 callback.callback());
72 EXPECT_EQ(1, mouselock_model.GetItemCount());
73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698