From 37cd84ac00880af370bcf7cd25d84e0e65d6c5f9 Mon Sep 17 00:00:00 2001 From: Robbie McElrath Date: Wed, 22 Jan 2025 10:53:07 -0800 Subject: [PATCH] iwa: Remove IWABuilder::TrustBundleAndInstall 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 Reviewed-by: Ahmed Fakhry Reviewed-by: Andrew Rayskiy Reviewed-by: Matt Reynolds Reviewed-by: Mike Wasserman Reviewed-by: Dibyajyoti Pal Commit-Queue: Robbie McElrath Reviewed-by: Andy Paicu Cr-Commit-Position: refs/heads/main@{#1409804} --- .../browsing_data_model_browsertest.cc | 4 +- .../protocol_handler_registry_browsertest.cc | 2 +- .../web_contents/web_app_tag_browsertest.cc | 4 +- .../shelf/chrome_shelf_controller_unittest.cc | 2 - .../ui/browser_navigator_iwa_browsertest.cc | 4 +- ...s_install_dialog_controller_browsertest.cc | 2 +- ...sub_apps_permissions_policy_browsertest.cc | 4 +- .../sub_apps_service_impl_browsertest.cc | 4 +- chrome/browser/usb/chrome_usb_browsertest.cc | 22 ++++---- ...ser_installed_web_apps_command_unittest.cc | 4 -- .../isolated_web_app_browsertest.cc | 53 +++++++------------ ...lated_web_app_file_handling_browsertest.cc | 2 +- ...solated_web_app_policy_manager_unittest.cc | 2 - .../test/isolated_web_app_builder.cc | 6 --- .../test/isolated_web_app_builder.h | 4 -- .../manifest_update_manager_browsertest.cc | 3 +- 16 files changed, 44 insertions(+), 78 deletions(-) diff --git a/chrome/browser/browsing_data/browsing_data_model_browsertest.cc b/chrome/browser/browsing_data/browsing_data_model_browsertest.cc index 5979ed9ee4d9e4..01dd5d8ddcd82e 100644 --- a/chrome/browser/browsing_data/browsing_data_model_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_model_browsertest.cc @@ -993,7 +993,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataModelBrowserTest, std::unique_ptr 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); @@ -1001,7 +1001,7 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataModelBrowserTest, std::unique_ptr 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); diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc index 853a9a55c1518d..cb48f1f0323453 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc @@ -382,7 +382,7 @@ IN_PROC_BROWSER_TEST_F(ChromeRegisterProtocolHandlerIsolatedWebAppsTest, std::unique_ptr 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 = diff --git a/chrome/browser/task_manager/providers/web_contents/web_app_tag_browsertest.cc b/chrome/browser/task_manager/providers/web_contents/web_app_tag_browsertest.cc index 29aef5d77d772d..d9a0e4c1346fc9 100644 --- a/chrome/browser/task_manager/providers/web_contents/web_app_tag_browsertest.cc +++ b/chrome/browser/task_manager/providers/web_contents/web_app_tag_browsertest.cc @@ -187,7 +187,7 @@ IN_PROC_BROWSER_TEST_F(WebAppTagIsolatedWebAppTest, IsolatedWebAppTaskCreated) { "IWA Document Title") .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()); @@ -225,7 +225,7 @@ IN_PROC_BROWSER_TEST_F(WebAppTagIsolatedWebAppTest, "IWA Document Title") .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; diff --git a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc index 91e7f706f5e1eb..b6738fca8cbdfc 100644 --- a/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc +++ b/chrome/browser/ui/ash/shelf/chrome_shelf_controller_unittest.cc @@ -1283,8 +1283,6 @@ class ChromeShelfControllerTestBase : public BrowserWithTestWindowTest, const std::unique_ptr 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( diff --git a/chrome/browser/ui/browser_navigator_iwa_browsertest.cc b/chrome/browser/ui/browser_navigator_iwa_browsertest.cc index 92f08595042b98..4f6dec5618b1ed 100644 --- a/chrome/browser/ui/browser_navigator_iwa_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_iwa_browsertest.cc @@ -113,7 +113,7 @@ class BrowserNavigatorIwaTest : public BrowserNavigatorTest { .BuildBundle(); url_info1_ = std::make_unique( - *app1_->TrustBundleAndInstall(profile())); + *app1_->Install(profile())); app2_ = web_app::IsolatedWebAppBuilder( @@ -121,7 +121,7 @@ class BrowserNavigatorIwaTest : public BrowserNavigatorTest { .BuildBundle(); url_info2_ = std::make_unique( - *app2_->TrustBundleAndInstall(profile())); + *app2_->Install(profile())); } protected: diff --git a/chrome/browser/ui/web_applications/sub_apps_install_dialog_controller_browsertest.cc b/chrome/browser/ui/web_applications/sub_apps_install_dialog_controller_browsertest.cc index 3cbd9da19dcec1..b074e13214c3a8 100644 --- a/chrome/browser/ui/web_applications/sub_apps_install_dialog_controller_browsertest.cc +++ b/chrome/browser/ui/web_applications/sub_apps_install_dialog_controller_browsertest.cc @@ -39,7 +39,7 @@ IN_PROC_BROWSER_TEST_F(SubAppsInstallDialogControllerBrowserTest, std::unique_ptr 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(); diff --git a/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc b/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc index 52dad54abbcff3..45312b009a00b1 100644 --- a/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc +++ b/chrome/browser/ui/web_applications/sub_apps_permissions_policy_browsertest.cc @@ -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(); @@ -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_); diff --git a/chrome/browser/ui/web_applications/sub_apps_service_impl_browsertest.cc b/chrome/browser/ui/web_applications/sub_apps_service_impl_browsertest.cc index f5eedb95bd23a6..db9ab401001d60 100644 --- a/chrome/browser/ui/web_applications/sub_apps_service_impl_browsertest.cc +++ b/chrome/browser/ui/web_applications/sub_apps_service_impl_browsertest.cc @@ -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, @@ -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); diff --git a/chrome/browser/usb/chrome_usb_browsertest.cc b/chrome/browser/usb/chrome_usb_browsertest.cc index cfa6814622b786..e74efaf90316df 100644 --- a/chrome/browser/usb/chrome_usb_browsertest.cc +++ b/chrome/browser/usb/chrome_usb_browsertest.cc @@ -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()); @@ -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 = ""; @@ -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'"; @@ -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 = @@ -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'"; @@ -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 = @@ -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"); @@ -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"); @@ -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"); @@ -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. @@ -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. diff --git a/chrome/browser/web_applications/commands/uninstall_all_user_installed_web_apps_command_unittest.cc b/chrome/browser/web_applications/commands/uninstall_all_user_installed_web_apps_command_unittest.cc index eb8e2485a45376..dbfbaf973b9c06 100644 --- a/chrome/browser/web_applications/commands/uninstall_all_user_installed_web_apps_command_unittest.cc +++ b/chrome/browser/web_applications/commands/uninstall_all_user_installed_web_apps_command_unittest.cc @@ -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(), @@ -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(), diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc index e68d6f2de29f0d..80a6fa710198c2 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_browsertest.cc @@ -261,12 +261,12 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, AppsPartitioned) { std::unique_ptr app1 = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info1, - app1->TrustBundleAndInstall(profile())); + app1->Install(profile())); std::unique_ptr app2 = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info2, - app2->TrustBundleAndInstall(profile())); + app2->Install(profile())); auto* non_app_frame = ui_test_utils::NavigateToURL( browser(), https_server()->GetURL("/simple.html")); @@ -290,8 +290,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, .AddFileFromDisk("/index.html", "web_apps/simple_isolated_app/index.html") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); GURL app_url = url_info.origin().GetURL().Resolve("/index.html"); auto* app_frame = @@ -336,8 +335,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, SameOriginWindowOpen) { IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, CrossOriginWindowOpen) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); @@ -388,8 +386,7 @@ IN_PROC_BROWSER_TEST_F( IsolatedWebAppBuilder( ManifestBuilder().SetDisplayMode(blink::mojom::DisplayMode::kBrowser)) .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); WebAppProvider::GetForTest(browser()->profile()) ->sync_bridge_unsafe() @@ -420,8 +417,7 @@ IN_PROC_BROWSER_TEST_F( IsolatedWebAppBuilder(ManifestBuilder().SetDisplayMode( blink::mojom::DisplayMode::kMinimalUi)) .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); GURL app_url = url_info.origin().GetURL(); auto* app_frame = @@ -444,8 +440,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, OpeningNonexistentPathShowsError) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); const GURL app_url = url_info.origin().GetURL().Resolve("/does_not_exist.html"); @@ -474,8 +469,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, NoOpenInChrome) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); Browser* app_browser = GetBrowserFromFrame(app_frame); @@ -499,8 +493,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, WasmLoadableFromFile) { .AddFileFromDisk("/empty.wasm", "web_apps/simple_isolated_app/empty.wasm") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); content::EvalJsResult result = EvalJs(app_frame, R"( @@ -517,8 +510,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, WasmLoadableFromFile) { IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, WasmLoadableFromBytes) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); content::EvalJsResult result = EvalJs(app_frame, R"( @@ -537,8 +529,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, WasmLoadableFromBytes) { IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, CanNavigateToBlobUrl) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); content::TestNavigationObserver navigation_observer( @@ -557,8 +548,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, CanNavigateToBlobUrl) { IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, WebCannotLoadIwaResources) { std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); ASSERT_TRUE(content::NavigateToURL(web_contents, @@ -581,12 +571,12 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, std::unique_ptr app1 = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info1, - app1->TrustBundleAndInstall(profile())); + app1->Install(profile())); std::unique_ptr app2 = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info2, - app2->TrustBundleAndInstall(profile())); + app2->Install(profile())); content::RenderFrameHost* app1_frame = OpenApp(url_info1.app_id()); content::TestNavigationObserver navigation_observer( @@ -658,8 +648,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, UseCounters) { base::HistogramTester histogram_tester; std::unique_ptr app = IsolatedWebAppBuilder(ManifestBuilder()).BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); histogram_tester.ExpectBucketCount("Blink.UseCounter.Features", blink::mojom::WebFeature::kPageVisits, 0); @@ -1282,8 +1271,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, SharedWorker) { .AddFileFromDisk("/shared_worker.js", "web_apps/simple_isolated_app/shared_worker.js") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame1 = OpenApp(url_info.app_id()); ASSERT_TRUE(ExecJs(app_frame1, register_worker_js)); @@ -1327,8 +1315,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedWebAppBrowserTest, DedicatedWorker) { .AddFileFromDisk("/dedicated_worker.js", "web_apps/simple_isolated_app/dedicated_worker.js") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); content::RenderFrameHost* app_frame = OpenApp(url_info.app_id()); ASSERT_TRUE(ExecJs(app_frame, register_worker_js)); @@ -1389,8 +1376,7 @@ IN_PROC_BROWSER_TEST_P(IsolatedWebAppExtensionBrowserTest, .AddFileFromDisk("/index.html", "web_apps/simple_isolated_app/index.html") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); { base::ScopedAllowBlockingForTesting allow_blocking; base::WriteFile(temp_dir_.GetPath().AppendASCII("manifest.json"), @@ -1436,8 +1422,7 @@ IN_PROC_BROWSER_TEST_P(IsolatedWebAppExtensionBrowserTest, ConnectToExtension) { .AddFileFromDisk("/index.html", "web_apps/simple_isolated_app/index.html") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); { base::ScopedAllowBlockingForTesting allow_blocking; base::WriteFile(temp_dir_.GetPath().AppendASCII("manifest.json"), diff --git a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_file_handling_browsertest.cc b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_file_handling_browsertest.cc index 8d31a35f8e04bb..38beca6fc144f6 100644 --- a/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_file_handling_browsertest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_file_handling_browsertest.cc @@ -40,7 +40,7 @@ class IsolatedWebAppFileHandlingBrowserTest return IsolatedWebAppBuilder( ManifestBuilder().AddFileHandler("/", {{"text/*", {".txt"}}})) .BuildBundle() - ->TrustBundleAndInstall(profile()) + ->Install(profile()) ->app_id(); } diff --git a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc index e2f7c0d360a63a..0cfbe088869745 100644 --- a/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc +++ b/chrome/browser/web_applications/isolated_web_apps/policy/isolated_web_app_policy_manager_unittest.cc @@ -341,8 +341,6 @@ TEST_F(IsolatedWebAppPolicyManagerTest, IsolatedWebAppBuilder(ManifestBuilder().SetVersion("1.0.0")) .BuildBundle(test::GetDefaultEd25519KeyPair()); - bundle->FakeInstallPageState(profile()); - bundle->TrustSigningKey(); ASSERT_OK_AND_ASSIGN(const IsolatedWebAppUrlInfo url_info, bundle->InstallWithSource( profile(), &IsolatedWebAppInstallSource::FromDevUi)); diff --git a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.cc b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.cc index 6cf64cc8a167cc..7113d17be6dd58 100644 --- a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.cc +++ b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.cc @@ -769,12 +769,6 @@ BundledIsolatedWebApp::FakeInstallPageState(Profile* profile) { profile, url_info, manifest_builder_.ToBlinkManifest(url_info.origin())); } -base::expected -BundledIsolatedWebApp::TrustBundleAndInstall(Profile* profile) { - TrustSigningKey(); - return Install(profile); -} - base::expected BundledIsolatedWebApp::InstallWithSource(Profile* profile, IsolatedWebAppInstallSource source, diff --git a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h index 074464d0c3a291..cdc9fe3d8517d5 100644 --- a/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h +++ b/chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_builder.h @@ -395,10 +395,6 @@ class BundledIsolatedWebApp { IwaSourceBundleModeAndFileOp::kProdModeCopy, InstallationTraits&&... traits); - // TODO(crbug.com/390443309): Delete this - base::expected TrustBundleAndInstall( - Profile* profile); - private: WITH_TRAITS(InstallationTraits) base::expected InstallWithSource( diff --git a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc index e0452adcf6869b..355216b6fb1cd2 100644 --- a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc +++ b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc @@ -2337,8 +2337,7 @@ IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerIsolatedWebAppBrowserTest, IsolatedWebAppBuilder(ManifestBuilder().SetStartUrl("/index.html")) .AddHtml("/index.html", "") .BuildBundle(); - ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, - app->TrustBundleAndInstall(profile())); + ASSERT_OK_AND_ASSIGN(IsolatedWebAppUrlInfo url_info, app->Install(profile())); UpdateCheckResultAwaiter awaiter( url_info.origin().GetURL().Resolve("/index.html"));