summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/data/extensions')
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/background.html6
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/background.js42
-rw-r--r--chrome/test/data/extensions/api_test/clear/api/manifest.json11
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html6
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js49
-rw-r--r--chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json11
6 files changed, 125 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/clear/api/background.html b/chrome/test/data/extensions/api_test/clear/api/background.html
new file mode 100644
index 0000000..ec9baec
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/api/background.html
@@ -0,0 +1,6 @@
+<!--
+ * 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.
+-->
+<script src="background.js"></script>
diff --git a/chrome/test/data/extensions/api_test/clear/api/background.js b/chrome/test/data/extensions/api_test/clear/api/background.js
new file mode 100644
index 0000000..08b78a8
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/api/background.js
@@ -0,0 +1,42 @@
+// 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.
+
+var allTypes = {
+ cache: true,
+ cookies: true,
+ downloads: true,
+ formData: true,
+ history: true,
+ passwords: true
+};
+chrome.test.runTests([
+ function testClearEverything() {
+ chrome.experimental.clear.browsingData("everything", allTypes,
+ chrome.test.callbackPass());
+ },
+ function testClearCache() {
+ chrome.experimental.clear.cache(
+ "everything", chrome.test.callbackPass());
+ },
+ function testClearCookies() {
+ chrome.experimental.clear.cookies(
+ "everything", chrome.test.callbackPass());
+ },
+ function testClearHistory() {
+ chrome.experimental.clear.history(
+ "everything", chrome.test.callbackPass());
+ },
+ function testClearPasswords() {
+ chrome.experimental.clear.passwords(
+ "everything", chrome.test.callbackPass());
+ },
+ function testClearDownloads() {
+ chrome.experimental.clear.downloads(
+ "everything", chrome.test.callbackPass());
+ },
+ function testClearFormData() {
+ chrome.experimental.clear.formData(
+ "everything", chrome.test.callbackPass());
+ }
+]);
diff --git a/chrome/test/data/extensions/api_test/clear/api/manifest.json b/chrome/test/data/extensions/api_test/clear/api/manifest.json
new file mode 100644
index 0000000..ecaa41d
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/api/manifest.json
@@ -0,0 +1,11 @@
+{
+ "name": "chrome.clear API Test",
+ "version": "0.1",
+ "manifest_version": 2,
+ "description": "end-to-end browser test for chrome.experimental.clear API",
+ "background_page": "background.html",
+ "permissions": [
+ "experimental",
+ "clear"
+ ]
+}
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html
new file mode 100644
index 0000000..ec9baec
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.html
@@ -0,0 +1,6 @@
+<!--
+ * 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.
+-->
+<script src="background.js"></script>
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js
new file mode 100644
index 0000000..6684cd5
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/one_at_a_time/background.js
@@ -0,0 +1,49 @@
+// 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.
+
+var allTypes = {
+ cache: true,
+ cookies: true,
+ downloads: true,
+ formData: true,
+ history: true,
+ passwords: true
+};
+chrome.test.runTests([
+ function testEverything() {
+ chrome.experimental.clear.browsingData("everything", allTypes,
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearCache() {
+ chrome.experimental.clear.cache("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearCookies() {
+ chrome.experimental.clear.cookies("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearHistory() {
+ chrome.experimental.clear.history("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearPasswords() {
+ chrome.experimental.clear.passwords("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearDownloads() {
+ chrome.experimental.clear.downloads("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ },
+ function testClearFormData() {
+ chrome.experimental.clear.formData("everything",
+ chrome.test.callbackFail(
+ 'Only one \'clear\' API call can run at a time.'));
+ }
+]);
diff --git a/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json b/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json
new file mode 100644
index 0000000..c06f819
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/clear/one_at_a_time/manifest.json
@@ -0,0 +1,11 @@
+{
+ "name": "chrome.clear API Test: One at a time.",
+ "version": "0.1",
+ "manifest_version": 2,
+ "description": "Checks that chrome.experimental.clear APIs can only be called if one's not already running.",
+ "background_page": "background.html",
+ "permissions": [
+ "experimental",
+ "clear"
+ ]
+}