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

Unified Diff: chrome/test/data/extensions/api_test/preference/persistent_incognito/test.js

Issue 8762014: Move another set of extension tests to manifest_version 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/preference/persistent_incognito/test.js
===================================================================
--- chrome/test/data/extensions/api_test/preference/persistent_incognito/test.js (revision 0)
+++ chrome/test/data/extensions/api_test/preference/persistent_incognito/test.js (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Content settings API test
+// Run with browser_tests --gtest_filter=ExtensionApiTest.PreferencePersistentIncognito
+
+var pw = chrome.experimental.privacy.websites;
+function expect(expected, message) {
+ return chrome.test.callbackPass(function(value) {
+ chrome.test.assertNoLastError();
+ chrome.test.assertEq(expected, value, message);
+ });
+}
+chrome.test.runTests([
+ function getRegular() {
+ pw.thirdPartyCookiesAllowed.get(
+ {},
+ expect({ 'value': true,
+ 'levelOfControl': "controllable_by_this_extension" },
+ "third-party cookies should not be blocked"));
+ },
+ function getIncognito() {
+ pw.thirdPartyCookiesAllowed.get(
+ { 'incognito': true },
+ expect({ 'value': true,
+ 'incognitoSpecific': false,
+ 'levelOfControl': "controllable_by_this_extension" },
+ "third-party cookies should not be blocked in incognito mode"));
+ },
+ function set() {
+ pw.thirdPartyCookiesAllowed.set(
+ { 'scope': 'incognito_persistent', 'value': false },
+ chrome.test.callbackPass());
+ },
+ function getRegular2() {
+ pw.thirdPartyCookiesAllowed.get(
+ {},
+ expect({ 'value': true,
+ 'levelOfControl': "controllable_by_this_extension" },
+ "third-party cookies should not be blocked"));
+ },
+ function getIncognito2() {
+ pw.thirdPartyCookiesAllowed.get(
+ { 'incognito': true },
+ expect({ 'value': false,
+ 'incognitoSpecific': true,
+ 'levelOfControl': "controlled_by_this_extension" },
+ "third-party cookies should be blocked in incognito mode"));
+ },
+]);

Powered by Google App Engine
This is Rietveld 408576698