OLD | NEW |
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/command.h" | 5 #include "chrome/common/extensions/command.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_util.h" | |
9 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 class CommandTest : public testing::Test { | 14 class CommandTest : public testing::Test { |
15 }; | 15 }; |
16 | 16 |
17 TEST(CommandTest, ExtensionCommandParsing) { | 17 TEST(CommandTest, ExtensionCommandParsing) { |
18 const ui::Accelerator none = ui::Accelerator(); | 18 const ui::Accelerator none = ui::Accelerator(); |
19 const ui::Accelerator shift_f = ui::Accelerator(ui::VKEY_F, | 19 const ui::Accelerator shift_f = ui::Accelerator(ui::VKEY_F, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 key_dict->SetString("windows", "Ctrl+Shift+W"); | 225 key_dict->SetString("windows", "Ctrl+Shift+W"); |
226 #endif | 226 #endif |
227 EXPECT_FALSE(command.Parse(input.get(), command_name, 0, &error)); | 227 EXPECT_FALSE(command.Parse(input.get(), command_name, 0, &error)); |
228 | 228 |
229 // Make sure Mac specific keys are not processed on other platforms. | 229 // Make sure Mac specific keys are not processed on other platforms. |
230 #if !defined(OS_MACOSX) | 230 #if !defined(OS_MACOSX) |
231 key_dict->SetString("windows", "Command+Shift+M"); | 231 key_dict->SetString("windows", "Command+Shift+M"); |
232 EXPECT_FALSE(command.Parse(input.get(), command_name, 0, &error)); | 232 EXPECT_FALSE(command.Parse(input.get(), command_name, 0, &error)); |
233 #endif | 233 #endif |
234 } | 234 } |
OLD | NEW |