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

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

Issue 378783002: Initial implementation of the <extensionoptions> GuestView tag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address lazyboy's comments Created 6 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "extensions/common/feature_switch.h"
7 #include "extensions/common/switches.h"
8
9 using extensions::Extension;
10 using extensions::FeatureSwitch;
11
12 class ExtensionOptionsApiTest : public ExtensionApiTest {
13 private:
14 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
15 // Need to add a command line flag as well as a FeatureSwitch because the
16 // FeatureSwitch is not copied over to the renderer process from the
17 // browser process.
18 command_line->AppendSwitch(
19 extensions::switches::kEnableEmbeddedExtensionOptions);
20 ExtensionApiTest::SetUpCommandLine(command_line);
21 }
22 };
23
24 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest, ExtensionCanEmbedOwnOptions) {
25 FeatureSwitch::ScopedOverride enable_options(
26 FeatureSwitch::embedded_extension_options(), true);
27
28 const Extension* extension = InstallExtension(
29 test_data_dir_.AppendASCII("extension_options").AppendASCII("embed_self"),
30 1);
31 ASSERT_TRUE(extension);
32 ASSERT_TRUE(RunExtensionSubtest("extension_options/embed_self", "test.html"));
33 }
34
35 IN_PROC_BROWSER_TEST_F(ExtensionOptionsApiTest,
36 EmbeddedOptionsCanAccessPrivilegedApis) {
37 FeatureSwitch::ScopedOverride enable_options(
38 FeatureSwitch::embedded_extension_options(), true);
39
40 const Extension* extension = InstallExtension(
41 test_data_dir_.AppendASCII("extension_options")
42 .AppendASCII("privileged_apis"),
43 1);
44 ASSERT_TRUE(extension);
45 ASSERT_TRUE(RunExtensionSubtest("extension_options/privileged_apis",
46 "test.html"));
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698