Commit e3b22001 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Convert BookmarkAppRegistrarBrowserTest to a HostedAppBrowserTest

This CL moves BookmarkAppRegistrarBrowserTest into being a
HostedAppBrowserTest. Additionally it renames the existing
HostedAppBrowserTests to HostedOrBookmarkAppBrowserTests to more
accurately reflect the params its instantiated.
Now HostedAppBrowserTest is only for hosted apps.

Branch: +hosted-app-not-web-app
Change-Id: Ic7dbe52669cf10895006d584a1d08ed8f7f8e8cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2059698
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742535}
parent f03e7101
...@@ -81,10 +81,7 @@ source_set("unit_tests") { ...@@ -81,10 +81,7 @@ source_set("unit_tests") {
source_set("browser_tests") { source_set("browser_tests") {
testonly = true testonly = true
sources = [ sources = [ "web_app_audio_focus_browsertest.cc" ]
"bookmark_app_registrar_browsertest.cc",
"web_app_audio_focus_browsertest.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
......
// 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.
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/web_applications/components/app_registrar.h"
#include "chrome/browser/web_applications/components/web_app_provider_base.h"
#include "extensions/test/test_extension_dir.h"
using BookmarkAppRegistrarBrowserTest = extensions::ExtensionBrowserTest;
IN_PROC_BROWSER_TEST_F(BookmarkAppRegistrarBrowserTest, HostedAppIsInstalled) {
// Install hosted app with web extents.
extensions::TestExtensionDir test_dir;
test_dir.WriteManifest(R"(
{
"name": "Hosted App",
"version": "1",
"manifest_version": 2,
"app": {
"launch": { "web_url": "https://app.com/" },
"urls": ["*://app.com/"]
}
}
)");
const extensions::Extension* hosted_app = InstallExtensionWithSourceAndFlags(
test_dir.UnpackedPath(), 1, extensions::Manifest::INTERNAL,
extensions::Extension::NO_FLAGS);
ASSERT_TRUE(hosted_app);
// BookmarkAppRegistrar should not consider app.com as having installed PWAs.
web_app::AppRegistrar& registrar =
web_app::WebAppProviderBase::GetProviderBase(profile())->registrar();
EXPECT_FALSE(registrar.IsLocallyInstalled(GURL("https://app.com/")));
EXPECT_FALSE(
registrar.IsLocallyInstalled(GURL("https://app.com/inner_page.html")));
}
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