OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/threading/thread_restrictions.h" |
8 #include "base/values.h" | 9 #include "base/values.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "chrome/browser/extensions/api/commands/command_service.h" | 11 #include "chrome/browser/extensions/api/commands/command_service.h" |
11 #include "chrome/browser/extensions/extension_apitest.h" | 12 #include "chrome/browser/extensions/extension_apitest.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
14 #include "components/prefs/scoped_user_pref_update.h" | 15 #include "components/prefs/scoped_user_pref_update.h" |
15 #include "content/public/test/browser_test.h" | 16 #include "content/public/test/browser_test.h" |
16 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
17 #include "extensions/common/manifest_constants.h" | 18 #include "extensions/common/manifest_constants.h" |
(...skipping 20 matching lines...) Expand all Loading... |
38 #endif | 39 #endif |
39 } | 40 } |
40 | 41 |
41 } // namespace | 42 } // namespace |
42 | 43 |
43 namespace extensions { | 44 namespace extensions { |
44 | 45 |
45 typedef ExtensionApiTest CommandServiceTest; | 46 typedef ExtensionApiTest CommandServiceTest; |
46 | 47 |
47 IN_PROC_BROWSER_TEST_F(CommandServiceTest, RemoveShortcutSurvivesUpdate) { | 48 IN_PROC_BROWSER_TEST_F(CommandServiceTest, RemoveShortcutSurvivesUpdate) { |
| 49 base::ThreadRestrictions::ScopedAllowIO allow_io; |
48 base::ScopedTempDir scoped_temp_dir; | 50 base::ScopedTempDir scoped_temp_dir; |
49 EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); | 51 EXPECT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); |
50 base::FilePath pem_path = test_data_dir_. | 52 base::FilePath pem_path = test_data_dir_. |
51 AppendASCII("keybinding").AppendASCII("keybinding.pem"); | 53 AppendASCII("keybinding").AppendASCII("keybinding.pem"); |
52 base::FilePath path_v1 = | 54 base::FilePath path_v1 = |
53 PackExtensionWithOptions(test_data_dir_.AppendASCII("keybinding") | 55 PackExtensionWithOptions(test_data_dir_.AppendASCII("keybinding") |
54 .AppendASCII("update") | 56 .AppendASCII("update") |
55 .AppendASCII("v1"), | 57 .AppendASCII("v1"), |
56 scoped_temp_dir.GetPath().AppendASCII("v1.crx"), | 58 scoped_temp_dir.GetPath().AppendASCII("v1.crx"), |
57 pem_path, base::FilePath()); | 59 pem_path, base::FilePath()); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 &command_map)); | 418 &command_map)); |
417 | 419 |
418 ASSERT_EQ(1u, command_map.count(kBasicNamedCommand)); | 420 ASSERT_EQ(1u, command_map.count(kBasicNamedCommand)); |
419 Command command = command_map[kBasicNamedCommand]; | 421 Command command = command_map[kBasicNamedCommand]; |
420 EXPECT_EQ(kBasicNamedKeybinding, | 422 EXPECT_EQ(kBasicNamedKeybinding, |
421 Command::AcceleratorToString(command.accelerator())); | 423 Command::AcceleratorToString(command.accelerator())); |
422 } | 424 } |
423 } | 425 } |
424 | 426 |
425 } // namespace extensions | 427 } // namespace extensions |
OLD | NEW |