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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_options_unittest.cc

Issue 574173002: Reland: Refactor ExtensionManifestTest to allow usage in src/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (manifest-test) add ScopedChannel 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 (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 "base/strings/stringprintf.h" 5 #include "base/strings/stringprintf.h"
6 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
7 #include "extensions/common/error_utils.h" 7 #include "extensions/common/error_utils.h"
8 #include "extensions/common/feature_switch.h" 8 #include "extensions/common/feature_switch.h"
9 #include "extensions/common/manifest_constants.h" 9 #include "extensions/common/manifest_constants.h"
10 #include "extensions/common/manifest_handlers/options_page_info.h" 10 #include "extensions/common/manifest_handlers/options_page_info.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 using namespace extensions; 13 using namespace extensions;
14 14
15 namespace errors = extensions::manifest_errors; 15 namespace errors = extensions::manifest_errors;
16 16
17 class OptionsPageManifestTest : public ExtensionManifestTest { 17 class OptionsPageManifestTest : public ChromeManifestTest {
18 }; 18 };
19 19
20 TEST_F(OptionsPageManifestTest, OptionsPageInApps) { 20 TEST_F(OptionsPageManifestTest, OptionsPageInApps) {
21 // Allow options page with absolute URL in hosted apps. 21 // Allow options page with absolute URL in hosted apps.
22 scoped_refptr<Extension> extension = 22 scoped_refptr<Extension> extension =
23 LoadAndExpectSuccess("hosted_app_absolute_options.json"); 23 LoadAndExpectSuccess("hosted_app_absolute_options.json");
24 EXPECT_EQ("http://example.com/options.html", 24 EXPECT_EQ("http://example.com/options.html",
25 OptionsPageInfo::GetOptionsPage(extension.get()).spec()); 25 OptionsPageInfo::GetOptionsPage(extension.get()).spec());
26 26
27 extension = LoadAndExpectSuccess("platform_app_with_options_page.json"); 27 extension = LoadAndExpectSuccess("platform_app_with_options_page.json");
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); 97 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get()));
98 98
99 extension = LoadAndExpectSuccess("options_ui_flags_false.json"); 99 extension = LoadAndExpectSuccess("options_ui_flags_false.json");
100 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); 100 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get()));
101 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); 101 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get()));
102 102
103 extension = LoadAndExpectSuccess("options_ui_page_basic.json"); 103 extension = LoadAndExpectSuccess("options_ui_page_basic.json");
104 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); 104 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get()));
105 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); 105 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get()));
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698