Commit 0665c898 authored by David Bertoni's avatar David Bertoni Committed by Commit Bot

[Extensions] Test storage APIs for SW without storage permissions.

Change-Id: I02623445a38902900fc80f00a98040712cd6b951
Reviewed-on: https://chromium-review.googlesource.com/c/1468164
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631989}
parent 4c6ae9ff
...@@ -302,6 +302,13 @@ IN_PROC_BROWSER_TEST_P(ServiceWorkerBasedBackgroundTest, StorageSetAndGet) { ...@@ -302,6 +302,13 @@ IN_PROC_BROWSER_TEST_P(ServiceWorkerBasedBackgroundTest, StorageSetAndGet) {
<< message_; << message_;
} }
// Tests chrome.storage.local and chrome.storage.local APIs.
IN_PROC_BROWSER_TEST_P(ServiceWorkerBasedBackgroundTest, StorageNoPermissions) {
ASSERT_TRUE(RunExtensionTest(
"service_worker/worker_based_background/storage_no_permissions"))
<< message_;
}
// Listens for |message| from extension Service Worker early so that tests can // Listens for |message| from extension Service Worker early so that tests can
// wait for the message on startup (and not miss it). // wait for the message on startup (and not miss it).
class ServiceWorkerWithEarlyMessageListenerTest class ServiceWorkerWithEarlyMessageListenerTest
......
{
"name": "Service Worker-based background script",
"version": "0.1",
"manifest_version": 2,
"description": "Test storage APIs for service worker-based background scripts.",
"permissions": [ ],
"background": {"service_worker_script": "service_worker_background.js"}
}
// Copyright 2019 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.
chrome.test.runTests([
function testStorageUndefined() {
try {
chrome.test.assertEq('undefined', typeof(chrome.storage));
chrome.test.succeed();
}
catch (e) {
chrome.test.fail(e);
}
},
]);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment