Commit 99cf9ba5 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

[Chrome App] Add test: sandboxed page and new window.

Add a new test, it makes use of chrome.app.window.create() with a
sandboxed page. It checks no window is returned to the background app.

There were no tests trying to open a new window with a sandboxed
document already.

Bug: 820995
Change-Id: I0e59723ee23b31845545774b3ff3dfede0278af0
Reviewed-on: https://chromium-review.googlesource.com/982627
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547657}
parent a38d0db1
...@@ -1399,4 +1399,8 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) { ...@@ -1399,4 +1399,8 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) {
"APP_WINDOW_CREATE_CALLBACK"); "APP_WINDOW_CREATE_CALLBACK");
} }
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, SandboxedLocalFile) {
ASSERT_TRUE(RunPlatformAppTest("platform_apps/sandboxed_local_file"));
}
} // namespace extensions } // namespace extensions
<!--
* Copyright (c) 2018 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.
-->
<html>
<body>
</body>
</html>
{
"name": "Platform App Test: Check window.create() doesn't give access to a sandboxed page.",
"manifest_version": 2,
"version": "1",
"app": {
"background": {
"scripts": ["test.js"]
}
},
"sandbox": {
"pages": [
"main.html"
]
}
}
// Copyright (c) 2018 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.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('main.html', {}, function (createdWindow) {
// 'main.html' is sandboxed, the new window should not be returned.
if (createdWindow)
chrome.test.notifyFail();
else
chrome.test.notifyPass();
})
});
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