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

Side by Side Diff: extensions/common/manifest_handlers/incognito_manifest_unittest.cc

Issue 1351223003: Allow extensions to specify that they are not allowed in incognito mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add expectations for IncognitoInfo to test Created 5 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
« no previous file with comments | « extensions/common/manifest_handlers/incognito_info.cc ('k') | extensions/extensions_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 "extensions/browser/extension_util.h"
6 #include "extensions/common/extension.h"
7 #include "extensions/common/manifest_handlers/incognito_info.h"
8 #include "extensions/common/manifest_test.h"
9
10 namespace extensions {
11
12 using IncognitoManifestTest = ManifestTest;
13
14 TEST_F(IncognitoManifestTest, IncognitoNotAllowed) {
15 scoped_refptr<Extension> extension(
16 LoadAndExpectSuccess("incognito_not_allowed.json"));
17 EXPECT_FALSE(IncognitoInfo::IsIncognitoAllowed(extension.get()));
18 EXPECT_FALSE(IncognitoInfo::IsSplitMode(extension.get()));
19 EXPECT_FALSE(util::CanBeIncognitoEnabled(extension.get()));
20 }
21
22 TEST_F(IncognitoManifestTest, IncognitoSpanning) {
23 scoped_refptr<Extension> extension(
24 LoadAndExpectSuccess("incognito_spanning.json"));
25 EXPECT_TRUE(IncognitoInfo::IsIncognitoAllowed(extension.get()));
26 EXPECT_FALSE(IncognitoInfo::IsSplitMode(extension.get()));
27 EXPECT_TRUE(util::CanBeIncognitoEnabled(extension.get()));
28 }
29
30 TEST_F(IncognitoManifestTest, IncognitoSplit) {
31 scoped_refptr<Extension> extension(
32 LoadAndExpectSuccess("incognito_split.json"));
33 EXPECT_TRUE(IncognitoInfo::IsIncognitoAllowed(extension.get()));
34 EXPECT_TRUE(IncognitoInfo::IsSplitMode(extension.get()));
35 EXPECT_TRUE(util::CanBeIncognitoEnabled(extension.get()));
36 }
37
38 TEST_F(IncognitoManifestTest, IncognitoUnspecified) {
39 scoped_refptr<Extension> extension(LoadAndExpectSuccess("minimal.json"));
40 EXPECT_TRUE(IncognitoInfo::IsIncognitoAllowed(extension.get()));
41 EXPECT_FALSE(IncognitoInfo::IsSplitMode(extension.get()));
42 EXPECT_TRUE(util::CanBeIncognitoEnabled(extension.get()));
43 }
44
45 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/manifest_handlers/incognito_info.cc ('k') | extensions/extensions_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698