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

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

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 "chrome/common/extensions/manifest_tests/extension_manifest_test.h" 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
6 6
7 #include "chrome/common/extensions/extension_manifest_constants.h" 7 #include "chrome/common/extensions/extension_manifest_constants.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace errors = extension_manifest_errors; 10 namespace errors = extension_manifest_errors;
11 11
12 TEST_F(ExtensionManifestTest, OptionsPageInApps) { 12 TEST_F(ExtensionManifestTest, OptionsPageInApps) {
13 scoped_refptr<Extension> extension; 13 scoped_refptr<extensions::Extension> extension;
14 14
15 // Allow options page with absolute URL in hosted apps. 15 // Allow options page with absolute URL in hosted apps.
16 extension = LoadAndExpectSuccess("hosted_app_absolute_options.json"); 16 extension = LoadAndExpectSuccess("hosted_app_absolute_options.json");
17 EXPECT_STREQ("http", 17 EXPECT_STREQ("http",
18 extension->options_url().scheme().c_str()); 18 extension->options_url().scheme().c_str());
19 EXPECT_STREQ("example.com", 19 EXPECT_STREQ("example.com",
20 extension->options_url().host().c_str()); 20 extension->options_url().host().c_str());
21 EXPECT_STREQ("options.html", 21 EXPECT_STREQ("options.html",
22 extension->options_url().ExtractFileName().c_str()); 22 extension->options_url().ExtractFileName().c_str());
23 23
24 Testcase testcases[] = { 24 Testcase testcases[] = {
25 // Forbid options page with relative URL in hosted apps. 25 // Forbid options page with relative URL in hosted apps.
26 Testcase("hosted_app_relative_options.json", 26 Testcase("hosted_app_relative_options.json",
27 errors::kInvalidOptionsPageInHostedApp), 27 errors::kInvalidOptionsPageInHostedApp),
28 28
29 // Forbid options page with non-(http|https) scheme in hosted app. 29 // Forbid options page with non-(http|https) scheme in hosted app.
30 Testcase("hosted_app_file_options.json", 30 Testcase("hosted_app_file_options.json",
31 errors::kInvalidOptionsPageInHostedApp), 31 errors::kInvalidOptionsPageInHostedApp),
32 32
33 // Forbid absolute URL for options page in packaged apps. 33 // Forbid absolute URL for options page in packaged apps.
34 Testcase("packaged_app_absolute_options.json", 34 Testcase("packaged_app_absolute_options.json",
35 errors::kInvalidOptionsPageExpectUrlInPackage) 35 errors::kInvalidOptionsPageExpectUrlInPackage)
36 }; 36 };
37 RunTestcases(testcases, arraysize(testcases), 37 RunTestcases(testcases, arraysize(testcases),
38 EXPECT_TYPE_ERROR); 38 EXPECT_TYPE_ERROR);
39 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698