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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc

Issue 950053002: Cache the Windows Parental Controls Platform Answer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced and All Unit Tests Fixed Created 5 years, 9 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/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
10 #include "chrome/browser/prefs/incognito_mode_prefs.h" 10 #include "chrome/browser/prefs/incognito_mode_prefs.h"
11 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" 11 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h"
12 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 12 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
13 #include "chrome/test/base/testing_profile.h" 13 #include "chrome/test/base/testing_profile.h"
14 #include "content/public/browser/web_contents.h" 14 #include "content/public/browser/web_contents.h"
15 #include "extensions/browser/extension_prefs.h" 15 #include "extensions/browser/extension_prefs.h"
16 #include "extensions/common/url_pattern.h" 16 #include "extensions/common/url_pattern.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/WebKit/public/web/WebContextMenuData.h" 18 #include "third_party/WebKit/public/web/WebContextMenuData.h"
19 #include "url/gurl.h" 19 #include "url/gurl.h"
20 20
21 #if defined(OS_WIN)
22 #include "chrome/browser/prefs/incognito_mode_prefs.h"
23 #endif // defined(OS_WIN)
24
21 using extensions::MenuItem; 25 using extensions::MenuItem;
22 using extensions::URLPatternSet; 26 using extensions::URLPatternSet;
23 27
24 class RenderViewContextMenuTest : public testing::Test { 28 class RenderViewContextMenuTest : public testing::Test {
25 protected: 29 protected:
30 #if defined(OS_WIN)
31 static void SetUpTestCase() {
32 IncognitoModePrefs::InitializePlatformParentalControls();
33 }
34 #endif // defined(OS_WIN)
35
26 // Proxy defined here to minimize friend classes in RenderViewContextMenu 36 // Proxy defined here to minimize friend classes in RenderViewContextMenu
27 static bool ExtensionContextAndPatternMatch( 37 static bool ExtensionContextAndPatternMatch(
28 const content::ContextMenuParams& params, 38 const content::ContextMenuParams& params,
29 MenuItem::ContextList contexts, 39 MenuItem::ContextList contexts,
30 const URLPatternSet& patterns) { 40 const URLPatternSet& patterns) {
31 return RenderViewContextMenu::ExtensionContextAndPatternMatch(params, 41 return RenderViewContextMenu::ExtensionContextAndPatternMatch(params,
32 contexts, patterns); 42 contexts, patterns);
33 } 43 }
34 }; 44 };
35 45
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 301 }
292 302
293 // Make sure the checking custom command id that is not enabled will not 303 // Make sure the checking custom command id that is not enabled will not
294 // cause DCHECK failure. 304 // cause DCHECK failure.
295 TEST_F(RenderViewContextMenuPrefsTest, 305 TEST_F(RenderViewContextMenuPrefsTest,
296 IsCustomCommandIdEnabled) { 306 IsCustomCommandIdEnabled) {
297 scoped_ptr<TestRenderViewContextMenu> menu(CreateContextMenu()); 307 scoped_ptr<TestRenderViewContextMenu> menu(CreateContextMenu());
298 308
299 EXPECT_FALSE(menu->IsCommandIdEnabled(IDC_CONTENT_CONTEXT_CUSTOM_FIRST)); 309 EXPECT_FALSE(menu->IsCommandIdEnabled(IDC_CONTENT_CONTEXT_CUSTOM_FIRST));
300 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698