OLD | NEW |
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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/test/base/ui_test_utils.h" | 8 #include "chrome/test/base/ui_test_utils.h" |
9 #include "extensions/common/feature_switch.h" | 9 #include "extensions/common/feature_switch.h" |
10 #include "extensions/common/switches.h" | 10 #include "extensions/common/switches.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Need to add a command line flag as well as a FeatureSwitch because the | 23 // Need to add a command line flag as well as a FeatureSwitch because the |
24 // FeatureSwitch is not copied over to the renderer process from the | 24 // FeatureSwitch is not copied over to the renderer process from the |
25 // browser process. | 25 // browser process. |
26 command_line->AppendSwitch( | 26 command_line->AppendSwitch( |
27 extensions::switches::kEnableEmbeddedExtensionOptions); | 27 extensions::switches::kEnableEmbeddedExtensionOptions); |
28 } | 28 } |
29 | 29 |
30 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_; | 30 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_; |
31 }; | 31 }; |
32 | 32 |
33 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, ExtensionCanEmbedOwnOptions) { | 33 // crbug/415949. |
| 34 #if defined(OS_MACOSX) |
| 35 #define MAYBE_ExtensionCanEmbedOwnOptions DISABLED_ExtensionCanEmbedOwnOptions |
| 36 #else |
| 37 #define MAYBE_ExtensionCanEmbedOwnOptions ExtensionCanEmbedOwnOptions |
| 38 #endif |
| 39 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, |
| 40 MAYBE_ExtensionCanEmbedOwnOptions) { |
34 base::FilePath extension_dir = | 41 base::FilePath extension_dir = |
35 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"); | 42 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"); |
36 ASSERT_TRUE(LoadExtension(extension_dir)); | 43 ASSERT_TRUE(LoadExtension(extension_dir)); |
37 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html")); | 44 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html")); |
38 } | 45 } |
39 | 46 |
40 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, | 47 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, |
41 ShouldNotEmbedOtherExtensionsOptions) { | 48 ShouldNotEmbedOtherExtensionsOptions) { |
42 base::FilePath dir = test_data_dir_.AppendASCII("extension_options") | 49 base::FilePath dir = test_data_dir_.AppendASCII("extension_options") |
43 .AppendASCII("embed_other"); | 50 .AppendASCII("embed_other"); |
(...skipping 20 matching lines...) Expand all Loading... |
64 } | 71 } |
65 | 72 |
66 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, | 73 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, |
67 CannotEmbedUsingInvalidExtensionIds) { | 74 CannotEmbedUsingInvalidExtensionIds) { |
68 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("extension_options") | 75 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("extension_options") |
69 .AppendASCII("embed_invalid"), | 76 .AppendASCII("embed_invalid"), |
70 1)); | 77 1)); |
71 ASSERT_TRUE( | 78 ASSERT_TRUE( |
72 RunExtensionSubtest("extension_options/embed_invalid", "test.html")); | 79 RunExtensionSubtest("extension_options/embed_invalid", "test.html")); |
73 } | 80 } |
OLD | NEW |