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

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

Issue 1047943002: Cache --whitelisted-extension-id in SimpleFeature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests that fail on memory bots. Created 5 years, 8 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
7 #include "extensions/common/constants.h" 7 #include "extensions/common/constants.h"
8 #include "extensions/common/extension.h" 8 #include "extensions/common/extension.h"
9 #include "extensions/common/features/simple_feature.h"
9 #include "extensions/common/manifest_handlers/launcher_page_info.h" 10 #include "extensions/common/manifest_handlers/launcher_page_info.h"
10 #include "extensions/common/switches.h" 11 #include "extensions/common/switches.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 namespace { 16 namespace {
16 17
17 // The ID of test manifests requiring whitelisting. 18 // The ID of test manifests requiring whitelisting.
18 const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl"; 19 const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl";
19 20
20 } // namespace 21 } // namespace
21 22
22 typedef ChromeManifestTest LauncherPageManifestTest; 23 typedef ChromeManifestTest LauncherPageManifestTest;
23 24
24 TEST_F(LauncherPageManifestTest, ValidLauncherPage) { 25 TEST_F(LauncherPageManifestTest, ValidLauncherPage) {
25 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 26 extensions::SimpleFeature::ScopedWhitelistForTest whitelist(kWhitelistID);
26 extensions::switches::kWhitelistedExtensionID, kWhitelistID);
27 scoped_refptr<extensions::Extension> extension( 27 scoped_refptr<extensions::Extension> extension(
28 LoadAndExpectSuccess("init_valid_launcher_page.json")); 28 LoadAndExpectSuccess("init_valid_launcher_page.json"));
29 ASSERT_TRUE(extension.get()); 29 ASSERT_TRUE(extension.get());
30 extensions::LauncherPageInfo* info = 30 extensions::LauncherPageInfo* info =
31 extensions::LauncherPageHandler::GetInfo(extension.get()); 31 extensions::LauncherPageHandler::GetInfo(extension.get());
32 ASSERT_TRUE(info); 32 ASSERT_TRUE(info);
33 EXPECT_EQ("test.html", info->page); 33 EXPECT_EQ("test.html", info->page);
34 } 34 }
35 35
36 } // namespace extensions 36 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698