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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_command_unittest.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/extensions/manifest_tests/extension_manifest_test.h" 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/extensions/extension_manifest_constants.h" 10 #include "chrome/common/extensions/extension_manifest_constants.h"
(...skipping 12 matching lines...) Expand all
23 #endif 23 #endif
24 24
25 const ui::Accelerator ctrl_f = ui::Accelerator(ui::VKEY_F, ctrl); 25 const ui::Accelerator ctrl_f = ui::Accelerator(ui::VKEY_F, ctrl);
26 const ui::Accelerator ctrl_shift_f = 26 const ui::Accelerator ctrl_shift_f =
27 ui::Accelerator(ui::VKEY_F, ctrl | ui::EF_SHIFT_DOWN); 27 ui::Accelerator(ui::VKEY_F, ctrl | ui::EF_SHIFT_DOWN);
28 const ui::Accelerator alt_shift_f = 28 const ui::Accelerator alt_shift_f =
29 ui::Accelerator(ui::VKEY_F, ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN); 29 ui::Accelerator(ui::VKEY_F, ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN);
30 30
31 scoped_refptr<extensions::Extension> extension = 31 scoped_refptr<extensions::Extension> extension =
32 LoadAndExpectSuccess("command_simple.json"); 32 LoadAndExpectSuccess("command_simple.json");
33 ASSERT_TRUE(extension); 33 ASSERT_TRUE(extension.get());
34 34
35 const extensions::CommandMap& commands = extension->named_commands(); 35 const extensions::CommandMap& commands = extension->named_commands();
36 ASSERT_EQ(1u, commands.size()); 36 ASSERT_EQ(1u, commands.size());
37 extensions::CommandMap::const_iterator iter = commands.begin(); 37 extensions::CommandMap::const_iterator iter = commands.begin();
38 ASSERT_TRUE(commands.end() != iter); 38 ASSERT_TRUE(commands.end() != iter);
39 const extensions::Command* named_command = &(*iter).second; 39 const extensions::Command* named_command = &(*iter).second;
40 ASSERT_STREQ("feature1", named_command->command_name().c_str()); 40 ASSERT_STREQ("feature1", named_command->command_name().c_str());
41 ASSERT_STREQ("desc", UTF16ToASCII(named_command->description()).c_str()); 41 ASSERT_STREQ("desc", UTF16ToASCII(named_command->description()).c_str());
42 ASSERT_EQ(ctrl_shift_f, named_command->accelerator()); 42 ASSERT_EQ(ctrl_shift_f, named_command->accelerator());
43 43
(...skipping 30 matching lines...) Expand all
74 LoadAndExpectSuccess("command_allow_numbers.json"); 74 LoadAndExpectSuccess("command_allow_numbers.json");
75 } 75 }
76 76
77 TEST_F(ExtensionManifestTest, CommandManifestRejectJustShift) { 77 TEST_F(ExtensionManifestTest, CommandManifestRejectJustShift) {
78 CommandLine::ForCurrentProcess()->AppendSwitch( 78 CommandLine::ForCurrentProcess()->AppendSwitch(
79 switches::kEnableExperimentalExtensionApis); 79 switches::kEnableExperimentalExtensionApis);
80 80
81 LoadAndExpectError("command_reject_just_shift.json", 81 LoadAndExpectError("command_reject_just_shift.json",
82 errors::kInvalidKeyBinding); 82 errors::kInvalidKeyBinding);
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698