Commit 725cde7c authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

[Chrome Apps] Test open new window with file not found.

Add a new Chrome Apps test. It tries to open a new window using
chrome.app.window.create() with a file that does not exist.
The callback must be called with createdWindow == undefined.

Bug: 820995
Change-Id: Iaffe9373e2f19f30d473f3bd165c1a2822f85073
Reviewed-on: https://chromium-review.googlesource.com/986437
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548736}
parent 4a0c43b1
...@@ -1399,6 +1399,11 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) { ...@@ -1399,6 +1399,11 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWindowIframe) {
"APP_WINDOW_CREATE_CALLBACK"); "APP_WINDOW_CREATE_CALLBACK");
} }
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, NewWindowWithNonExistingFile) {
ASSERT_TRUE(
RunPlatformAppTest("platform_apps/new_window_with_non_existing_file"));
}
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, SandboxedLocalFile) { IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, SandboxedLocalFile) {
ASSERT_TRUE(RunPlatformAppTest("platform_apps/sandboxed_local_file")); ASSERT_TRUE(RunPlatformAppTest("platform_apps/sandboxed_local_file"));
} }
......
{
"name": "Platform App Test: Use chrome.app.window.create() with an non existing file.",
"manifest_version": 2,
"version": "1",
"app": {
"background": {
"scripts": ["test.js"]
}
}
}
// 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('not_found.html', {}, function (createdWindow) {
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