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

Side by Side Diff: extensions/browser/guest_view/extension_options/extension_options_apitest.cc

Issue 564993002: Embedded Extension Options: remove flags and trunk channel restrictions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 "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"
11 #include "extensions/test/result_catcher.h" 11 #include "extensions/test/result_catcher.h"
12 12
13 using extensions::Extension; 13 using extensions::Extension;
14 using extensions::FeatureSwitch; 14 using extensions::FeatureSwitch;
15 15
16 class ExtensionOptionsApiTest : public ExtensionApiTest { 16 class ExtensionOptionsApiTest : public ExtensionApiTest {
17 private:
18 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
19 ExtensionApiTest::SetUpCommandLine(command_line);
20
21 enable_options_.reset(new FeatureSwitch::ScopedOverride(
22 FeatureSwitch::embedded_extension_options(), true));
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
25 // browser process.
26 command_line->AppendSwitch(
27 extensions::switches::kEnableEmbeddedExtensionOptions);
28 }
29
30 scoped_ptr<FeatureSwitch::ScopedOverride> enable_options_;
31 }; 17 };
32 18
33 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, ExtensionCanEmbedOwnOptions) { 19 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, ExtensionCanEmbedOwnOptions) {
34 base::FilePath extension_dir = 20 base::FilePath extension_dir =
35 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"); 21 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self");
36 ASSERT_TRUE(LoadExtension(extension_dir)); 22 ASSERT_TRUE(LoadExtension(extension_dir));
37 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html")); 23 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html"));
38 } 24 }
39 25
40 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, 26 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest,
(...skipping 23 matching lines...) Expand all
64 } 50 }
65 51
66 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, 52 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest,
67 CannotEmbedUsingInvalidExtensionIds) { 53 CannotEmbedUsingInvalidExtensionIds) {
68 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("extension_options") 54 ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("extension_options")
69 .AppendASCII("embed_invalid"), 55 .AppendASCII("embed_invalid"),
70 1)); 56 1));
71 ASSERT_TRUE( 57 ASSERT_TRUE(
72 RunExtensionSubtest("extension_options/embed_invalid", "test.html")); 58 RunExtensionSubtest("extension_options/embed_invalid", "test.html"));
73 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698