Skip to content

Commit

Permalink
iwa: Remove IWABuilder::TrustBundleAndInstall
Browse files Browse the repository at this point in the history
This function isn't needed anymore now that ::Install marks the key
as trusted by default.

Bug: 390443309
Change-Id: Ic838be98d49ca705bb83271282ec4fd6a79e43db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6181125
Reviewed-by: Mariam Ali <[email protected]>
Reviewed-by: Ahmed Fakhry <[email protected]>
Reviewed-by: Andrew Rayskiy <[email protected]>
Reviewed-by: Matt Reynolds <[email protected]>
Reviewed-by: Mike Wasserman <[email protected]>
Reviewed-by: Dibyajyoti Pal <[email protected]>
Commit-Queue: Robbie McElrath <[email protected]>
Reviewed-by: Andy Paicu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1409804}
  • Loading branch information
robbiemc authored and Chromium LUCI CQ committed Jan 22, 2025
1 parent 6e51bc2 commit 37cd84a
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -993,15 +993,15 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataModelBrowserTest,
std::unique_ptr<web_app::ScopedBundledIsolatedWebApp> app1 =
web_app::IsolatedWebAppBuilder(web_app::ManifestBuilder()).BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo iwa_url_info1,
app1->TrustBundleAndInstall(profile));
app1->Install(profile));
auto* iwa_frame1 =
web_app::OpenIsolatedWebApp(profile, iwa_url_info1.app_id());
AddLocalStorageUsage(iwa_frame1, 100);

std::unique_ptr<web_app::ScopedBundledIsolatedWebApp> app2 =
web_app::IsolatedWebAppBuilder(web_app::ManifestBuilder()).BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo iwa_url_info2,
app2->TrustBundleAndInstall(profile));
app2->Install(profile));
auto* iwa_frame2 =
web_app::OpenIsolatedWebApp(profile, iwa_url_info2.app_id());
AddLocalStorageUsage(iwa_frame2, 500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ IN_PROC_BROWSER_TEST_F(ChromeRegisterProtocolHandlerIsolatedWebAppsTest,
std::unique_ptr<web_app::ScopedBundledIsolatedWebApp> app =
web_app::IsolatedWebAppBuilder(web_app::ManifestBuilder()).BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));

Browser* browser = LaunchWebAppBrowserAndWait(url_info.app_id());
content::WebContents* web_contents =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ IN_PROC_BROWSER_TEST_F(WebAppTagIsolatedWebAppTest, IsolatedWebAppTaskCreated) {
"<html><head><title>IWA Document Title</title></head></html>")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
webapps::AppId app_id = url_info.app_id();
MockWebContentsTaskManager task_manager;
EXPECT_TRUE(task_manager.tasks().empty());
Expand Down Expand Up @@ -225,7 +225,7 @@ IN_PROC_BROWSER_TEST_F(WebAppTagIsolatedWebAppTest,
"<html><head><title>IWA Document Title</title></head></html>")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
webapps::AppId app_id = url_info.app_id();

MockWebContentsTaskManager task_manager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,6 @@ class ChromeShelfControllerTestBase : public BrowserWithTestWindowTest,
const std::unique_ptr<web_app::ScopedBundledIsolatedWebApp> app_bundle =
web_app::IsolatedWebAppBuilder(web_app::ManifestBuilder())
.BuildBundle();
app_bundle->FakeInstallPageState(profile());
app_bundle->TrustSigningKey();
const web_app::IsolatedWebAppUrlInfo url_info =
app_bundle
->InstallWithSource(
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/browser_navigator_iwa_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ class BrowserNavigatorIwaTest : public BrowserNavigatorTest {
.BuildBundle();

url_info1_ = std::make_unique<web_app::IsolatedWebAppUrlInfo>(
*app1_->TrustBundleAndInstall(profile()));
*app1_->Install(profile()));

app2_ =
web_app::IsolatedWebAppBuilder(
web_app::ManifestBuilder().SetName("app-1.0.0").SetVersion("1.0.0"))
.BuildBundle();

url_info2_ = std::make_unique<web_app::IsolatedWebAppUrlInfo>(
*app2_->TrustBundleAndInstall(profile()));
*app2_->Install(profile()));
}

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ IN_PROC_BROWSER_TEST_F(SubAppsInstallDialogControllerBrowserTest,
std::unique_ptr<ScopedBundledIsolatedWebApp> app =
IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle();
ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo parent_app,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
const webapps::AppId parent_app_id = parent_app.app_id();

auto controller = std::make_unique<SubAppsInstallDialogController>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SubAppsPermissionsPolicyBrowserTest
.SetName("Parent apps test app")
.SetVersion("1.0.0"))
.BuildBundle()
->TrustBundleAndInstall(profile());
->Install(profile());

parent_app_id_ = url_info.app_id();

Expand All @@ -58,7 +58,7 @@ class SubAppsPermissionsPolicyBrowserTest
.SetVersion(installed_version.GetString()))
.BuildBundle();

*bundle->TrustBundleAndInstall(profile());
*bundle->Install(profile());

const WebApp* web_app =
provider().registrar_unsafe().GetAppById(parent_app_id_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ IN_PROC_BROWSER_TEST_F(SubAppsServiceImplBrowserTest,
ManifestBuilder().AddPermissionsPolicy(
blink::mojom::PermissionsPolicyFeature::kSubApps, true, {}))
.BuildBundle()
->TrustBundleAndInstall(profile()));
->Install(profile()));
content::RenderFrameHost* iwa_frame_2 = OpenApp(parent_app_2.app_id());

EXPECT_EQ(proto::InstallState::INSTALLED_WITH_OS_INTEGRATION,
Expand Down Expand Up @@ -1231,7 +1231,7 @@ IN_PROC_BROWSER_TEST_F(SubAppsServiceImplBrowserTest, RemoveFailWrongParent) {
ManifestBuilder().AddPermissionsPolicy(
blink::mojom::PermissionsPolicyFeature::kSubApps, true, {}))
.BuildBundle()
->TrustBundleAndInstall(profile()));
->Install(profile()));
content::RenderFrameHost* iwa_frame_2 = OpenApp(parent_app_2.app_id());
remote_.reset();
BindRemote(iwa_frame_2);
Expand Down
22 changes: 11 additions & 11 deletions chrome/browser/usb/chrome_usb_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppUsbBrowserTest, ClaimInterface) {
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));

content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

Expand Down Expand Up @@ -730,7 +730,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

const std::string permissions_policy = "";
Expand Down Expand Up @@ -767,7 +767,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

const std::string permissions_policy = "usb 'self'";
Expand Down Expand Up @@ -806,7 +806,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

GURL non_app_url =
Expand Down Expand Up @@ -849,7 +849,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

const std::string permissions_policy = "usb 'none'";
Expand Down Expand Up @@ -880,7 +880,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kUsb))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

GURL non_app_url =
Expand Down Expand Up @@ -914,7 +914,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
"web_apps/simple_isolated_app/usb_none.html")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

GURL app_url = url_info.origin().GetURL().Resolve("/usb_none.html");
Expand Down Expand Up @@ -960,7 +960,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
"web_apps/simple_isolated_app/usb_self.html")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

GURL app_url = url_info.origin().GetURL().Resolve("/usb_self.html");
Expand Down Expand Up @@ -1003,7 +1003,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
"web_apps/simple_isolated_app/usb_all.html")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

GURL app_url = url_info.origin().GetURL().Resolve("/usb_all.html");
Expand Down Expand Up @@ -1044,7 +1044,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
blink::mojom::PermissionsPolicyFeature::kCrossOriginIsolated))
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

// Create a fake device with protected class and grant permission.
Expand Down Expand Up @@ -1113,7 +1113,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppPermissionsPolicyBrowserTest,
.AddHtml("/empty.html", "Empty Page")
.BuildBundle();
ASSERT_OK_AND_ASSIGN(web_app::IsolatedWebAppUrlInfo url_info,
app->TrustBundleAndInstall(profile()));
app->Install(profile()));
content::RenderFrameHost* app_frame = OpenApp(url_info.app_id());

// Create a fake device with protected class and grant permission.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ TEST_F(UninstallAllUserInstalledWebAppsCommandTest,
web_app::IsolatedWebAppBuilder(
web_app::ManifestBuilder().SetName("iwa from dev ui"))
.BuildBundle();
app_bundle4->FakeInstallPageState(profile());
app_bundle4->TrustSigningKey();
webapps::AppId app_id4 =
app_bundle4
->InstallWithSource(profile(),
Expand All @@ -179,8 +177,6 @@ TEST_F(UninstallAllUserInstalledWebAppsCommandTest,
web_app::IsolatedWebAppBuilder(
web_app::ManifestBuilder().SetName("iwa from dev command line"))
.BuildBundle();
app_bundle5->FakeInstallPageState(profile());
app_bundle5->TrustSigningKey();
webapps::AppId app_id5 =
app_bundle5
->InstallWithSource(profile(),
Expand Down
Loading

0 comments on commit 37cd84a

Please sign in to comment.