-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iwa: Implement GetMetadataScreen installer UI
This isn't currently hooked up to the Command to get the metadata yet. Bug: 1479140 Change-Id: Id941f1ff9523b0d37c978a005f0aed58d6d2e651 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4944693 Commit-Queue: Robbie McElrath <rmcelrath@chromium.org> Reviewed-by: Zelin Liu <zelin@chromium.org> Cr-Commit-Position: refs/heads/main@{#1212900}
- Loading branch information
Showing
12 changed files
with
242 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
chrome/app/generated_resources_grd/IDS_IWA_INSTALLER_VERIFICATION_STATUS.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9a1a4e1467fab9711d271f062fff815c40070272 |
1 change: 1 addition & 0 deletions
1
chrome/app/generated_resources_grd/IDS_IWA_INSTALLER_VERIFICATION_SUBTITLE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9cd1341fe1f3fdeeae715f9778940274c6727a74 |
1 change: 1 addition & 0 deletions
1
chrome/app/generated_resources_grd/IDS_IWA_INSTALLER_VERIFICATION_TITLE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d8f5b9daf9334d4409afd67c965d783f463699e8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...rowser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_browsertest.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view.h" | ||
|
||
#include <string> | ||
|
||
#include "base/files/file_path.h" | ||
#include "base/functional/callback_helpers.h" | ||
#include "base/test/scoped_feature_list.h" | ||
#include "chrome/browser/ui/browser.h" | ||
#include "chrome/browser/ui/test/pixel_test_configuration_mixin.h" | ||
#include "chrome/browser/ui/test/test_browser_dialog.h" | ||
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_model.h" | ||
#include "chrome/browser/ui/views/web_apps/isolated_web_apps/isolated_web_app_installer_view_controller.h" | ||
#include "chrome/browser/web_applications/web_app_provider.h" | ||
#include "chrome/test/base/mixin_based_in_process_browser_test.h" | ||
#include "content/public/common/content_features.h" | ||
#include "content/public/test/browser_test.h" | ||
|
||
namespace web_app { | ||
|
||
using Step = IsolatedWebAppInstallerModel::Step; | ||
|
||
struct TestParam { | ||
std::string test_suffix; | ||
Step step; | ||
bool use_dark_theme = false; | ||
bool use_right_to_left_language = false; | ||
}; | ||
|
||
// To be passed as 4th argument to `INSTANTIATE_TEST_SUITE_P()`, allows the test | ||
// to be named like `<TestClassName>.InvokeUi_default/<TestSuffix>` instead | ||
// of using the index of the param in `TestParam` as suffix. | ||
std::string ParamToTestSuffix(const ::testing::TestParamInfo<TestParam>& info) { | ||
return info.param.test_suffix; | ||
} | ||
|
||
const TestParam kTestParam[] = { | ||
{.test_suffix = "GetMetadata", .step = Step::kGetMetadata}, | ||
}; | ||
|
||
class IsolatedWebAppInstallerViewUiPixelTest | ||
: public TestBrowserDialog, | ||
public MixinBasedInProcessBrowserTest, | ||
public testing::WithParamInterface<TestParam> { | ||
public: | ||
IsolatedWebAppInstallerViewUiPixelTest() | ||
: pixel_test_mixin_(&mixin_host_, | ||
GetParam().use_dark_theme, | ||
GetParam().use_right_to_left_language) {} | ||
|
||
~IsolatedWebAppInstallerViewUiPixelTest() override = default; | ||
|
||
// `TestBrowserDialog`: | ||
void ShowUi(const std::string& name) override { | ||
IsolatedWebAppInstallerModel model{base::FilePath()}; | ||
model.SetStep(GetParam().step); | ||
|
||
IsolatedWebAppInstallerViewController controller{ | ||
WebAppProvider::GetForWebApps(browser()->profile()), &model}; | ||
controller.Show(base::DoNothing()); | ||
} | ||
|
||
private: | ||
base::test::ScopedFeatureList feature_list_{features::kIsolatedWebApps}; | ||
PixelTestConfigurationMixin pixel_test_mixin_; | ||
}; | ||
|
||
IN_PROC_BROWSER_TEST_P(IsolatedWebAppInstallerViewUiPixelTest, | ||
InvokeUi_default) { | ||
ShowAndVerifyUi(); | ||
} | ||
|
||
INSTANTIATE_TEST_SUITE_P(, | ||
IsolatedWebAppInstallerViewUiPixelTest, | ||
testing::ValuesIn(kTestParam), | ||
&ParamToTestSuffix); | ||
|
||
} // namespace web_app |
Oops, something went wrong.