Commit b4839fbd authored by Giovanni Ortuño Urquidi's avatar Giovanni Ortuño Urquidi Committed by Commit Bot

desktop-pwas: Plumb AppInfo through TestBookmarkAppInstallationTask

Changes TestBookmarkAppInstallationTask in
pending_bookmark_app_manager_unittest.cc to notify the test that
Install is called. Then the test saves a copy of the used AppInfo to
compare to the app info originally passed to PendingAppManager.

This helps make sure AppInfo is correctly plumbed from PendingAppManager
up until BookmarkAppInstallationTask which will use it to install the
app.

Bug: 876173
Change-Id: Iac87fc6e941f1da239717b306f1be44b18704320
Reviewed-on: https://chromium-review.googlesource.com/1186213
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585785}
parent f597024c
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include "chrome/browser/web_applications/components/pending_app_manager.h" #include "chrome/browser/web_applications/components/pending_app_manager.h"
#include <memory>
#include <utility>
namespace web_app { namespace web_app {
PendingAppManager::AppInfo::AppInfo(GURL url, LaunchContainer launch_container) PendingAppManager::AppInfo::AppInfo(GURL url, LaunchContainer launch_container)
...@@ -14,6 +17,13 @@ PendingAppManager::AppInfo::AppInfo(PendingAppManager::AppInfo&& other) = ...@@ -14,6 +17,13 @@ PendingAppManager::AppInfo::AppInfo(PendingAppManager::AppInfo&& other) =
PendingAppManager::AppInfo::~AppInfo() = default; PendingAppManager::AppInfo::~AppInfo() = default;
std::unique_ptr<PendingAppManager::AppInfo> PendingAppManager::AppInfo::Clone()
const {
auto other = std::make_unique<AppInfo>(url, launch_container);
DCHECK_EQ(*this, *other);
return other;
}
bool PendingAppManager::AppInfo::operator==( bool PendingAppManager::AppInfo::operator==(
const PendingAppManager::AppInfo& other) const { const PendingAppManager::AppInfo& other) const {
return std::tie(url, launch_container) == return std::tie(url, launch_container) ==
...@@ -24,4 +34,10 @@ PendingAppManager::PendingAppManager() = default; ...@@ -24,4 +34,10 @@ PendingAppManager::PendingAppManager() = default;
PendingAppManager::~PendingAppManager() = default; PendingAppManager::~PendingAppManager() = default;
std::ostream& operator<<(std::ostream& out,
const PendingAppManager::AppInfo& app_info) {
return out << "url: " << app_info.url << "\n launch_container: "
<< static_cast<int32_t>(app_info.launch_container);
}
} // namespace web_app } // namespace web_app
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_ #ifndef CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_
#define CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_
#include <memory>
#include <ostream>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -38,6 +40,8 @@ class PendingAppManager { ...@@ -38,6 +40,8 @@ class PendingAppManager {
AppInfo(AppInfo&& other); AppInfo(AppInfo&& other);
~AppInfo(); ~AppInfo();
std::unique_ptr<AppInfo> Clone() const;
bool operator==(const AppInfo& other) const; bool operator==(const AppInfo& other) const;
GURL url; GURL url;
...@@ -71,6 +75,9 @@ class PendingAppManager { ...@@ -71,6 +75,9 @@ class PendingAppManager {
DISALLOW_COPY_AND_ASSIGN(PendingAppManager); DISALLOW_COPY_AND_ASSIGN(PendingAppManager);
}; };
std::ostream& operator<<(std::ostream& out,
const PendingAppManager::AppInfo& app_info);
} // namespace web_app } // namespace web_app
#endif // CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_ #endif // CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_PENDING_APP_MANAGER_H_
...@@ -70,13 +70,21 @@ class TestBookmarkAppInstallationTask : public BookmarkAppInstallationTask { ...@@ -70,13 +70,21 @@ class TestBookmarkAppInstallationTask : public BookmarkAppInstallationTask {
result_code = BookmarkAppInstallationTask::ResultCode::kSuccess; result_code = BookmarkAppInstallationTask::ResultCode::kSuccess;
app_id = "fake_app_id_for:" + app_info().url.spec(); app_id = "fake_app_id_for:" + app_info().url.spec();
} }
std::move(on_install_called_).Run();
std::move(callback).Run( std::move(callback).Run(
BookmarkAppInstallationTask::Result(result_code, app_id)); BookmarkAppInstallationTask::Result(result_code, app_id));
} }
void SetOnInstallCalled(base::OnceClosure on_install_called) {
on_install_called_ = std::move(on_install_called);
}
private: private:
bool succeeds_; bool succeeds_;
base::OnceClosure on_install_called_;
DISALLOW_COPY_AND_ASSIGN(TestBookmarkAppInstallationTask); DISALLOW_COPY_AND_ASSIGN(TestBookmarkAppInstallationTask);
}; };
...@@ -114,18 +122,30 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness { ...@@ -114,18 +122,30 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness {
return web_contents; return web_contents;
} }
std::unique_ptr<BookmarkAppInstallationTask> CreateInstallationTask(
Profile* profile,
web_app::PendingAppManager::AppInfo app_info,
bool succeeds) {
auto task = std::make_unique<TestBookmarkAppInstallationTask>(
profile, std::move(app_info), succeeds);
auto* task_ptr = task.get();
task->SetOnInstallCalled(base::BindLambdaForTesting(
[task_ptr, this]() { last_app_info_ = task_ptr->app_info().Clone(); }));
return task;
}
std::unique_ptr<BookmarkAppInstallationTask> CreateSuccessfulInstallationTask( std::unique_ptr<BookmarkAppInstallationTask> CreateSuccessfulInstallationTask(
Profile* profile, Profile* profile,
web_app::PendingAppManager::AppInfo app_info) { web_app::PendingAppManager::AppInfo app_info) {
return std::make_unique<TestBookmarkAppInstallationTask>( return CreateInstallationTask(profile, std::move(app_info),
profile, std::move(app_info), true); true /* succeeds */);
} }
std::unique_ptr<BookmarkAppInstallationTask> CreateFailingInstallationTask( std::unique_ptr<BookmarkAppInstallationTask> CreateFailingInstallationTask(
Profile* profile, Profile* profile,
web_app::PendingAppManager::AppInfo app_info) { web_app::PendingAppManager::AppInfo app_info) {
return std::make_unique<TestBookmarkAppInstallationTask>( return CreateInstallationTask(profile, std::move(app_info),
profile, std::move(app_info), false); false /* succeeds */);
} }
void InstallCallback(const GURL& url, const std::string& app_id) { void InstallCallback(const GURL& url, const std::string& app_id) {
...@@ -137,6 +157,7 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness { ...@@ -137,6 +157,7 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness {
void ResetResults() { void ResetResults() {
install_succeeded_.reset(); install_succeeded_.reset();
install_callback_url_.reset(); install_callback_url_.reset();
last_app_info_.reset();
} }
const PendingBookmarkAppManager::WebContentsFactory& const PendingBookmarkAppManager::WebContentsFactory&
...@@ -175,10 +196,16 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness { ...@@ -175,10 +196,16 @@ class PendingBookmarkAppManagerTest : public ChromeRenderViewHostTestHarness {
const GURL& install_callback_url() { return install_callback_url_.value(); } const GURL& install_callback_url() { return install_callback_url_.value(); }
const web_app::PendingAppManager::AppInfo& last_app_info() {
CHECK(last_app_info_.get());
return *last_app_info_;
}
private: private:
content::WebContentsTester* web_contents_tester_ = nullptr; content::WebContentsTester* web_contents_tester_ = nullptr;
base::Optional<bool> install_succeeded_; base::Optional<bool> install_succeeded_;
base::Optional<GURL> install_callback_url_; base::Optional<GURL> install_callback_url_;
std::unique_ptr<web_app::PendingAppManager::AppInfo> last_app_info_;
PendingBookmarkAppManager::WebContentsFactory test_web_contents_creator_; PendingBookmarkAppManager::WebContentsFactory test_web_contents_creator_;
PendingBookmarkAppManager::TaskFactory successful_installation_task_creator_; PendingBookmarkAppManager::TaskFactory successful_installation_task_creator_;
...@@ -198,6 +225,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_Succeeds) { ...@@ -198,6 +225,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_Succeeds) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
} }
...@@ -212,6 +240,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_SucceedsTwice) { ...@@ -212,6 +240,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_SucceedsTwice) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -224,6 +253,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_SucceedsTwice) { ...@@ -224,6 +253,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_SucceedsTwice) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -243,6 +273,8 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ConcurrentCalls) { ...@@ -243,6 +273,8 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ConcurrentCalls) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
// Then the first call to Install gets processed. // Then the first call to Install gets processed.
...@@ -250,6 +282,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ConcurrentCalls) { ...@@ -250,6 +282,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ConcurrentCalls) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
} }
...@@ -272,6 +305,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingSuccessfulTask) { ...@@ -272,6 +305,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingSuccessfulTask) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -280,6 +314,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingSuccessfulTask) { ...@@ -280,6 +314,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingSuccessfulTask) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -310,6 +345,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingFailingTask) { ...@@ -310,6 +345,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingFailingTask) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -332,6 +368,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ReentrantCallback) { ...@@ -332,6 +368,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ReentrantCallback) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -339,6 +376,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ReentrantCallback) { ...@@ -339,6 +376,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_ReentrantCallback) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -364,6 +402,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_FailsSameInstallPending) { ...@@ -364,6 +402,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_FailsSameInstallPending) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
} }
...@@ -394,6 +433,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Succeeds) { ...@@ -394,6 +433,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Succeeds) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
} }
...@@ -431,6 +471,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Multiple) { ...@@ -431,6 +471,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Multiple) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -439,6 +480,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Multiple) { ...@@ -439,6 +480,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_Multiple) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -470,6 +512,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstallApps) { ...@@ -470,6 +512,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstallApps) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -478,6 +521,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstallApps) { ...@@ -478,6 +521,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstallApps) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -505,6 +549,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) { ...@@ -505,6 +549,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) {
SuccessfullyLoad(GURL(kQuxWebAppUrl)); SuccessfullyLoad(GURL(kQuxWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetQuxAppInfo(), last_app_info());
EXPECT_EQ(GURL(kQuxWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kQuxWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -513,6 +558,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) { ...@@ -513,6 +558,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) {
SuccessfullyLoad(GURL(kFooWebAppUrl)); SuccessfullyLoad(GURL(kFooWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -520,6 +566,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) { ...@@ -520,6 +566,7 @@ TEST_F(PendingBookmarkAppManagerTest, Install_PendingMulitpleInstallApps) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -546,6 +593,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstall) { ...@@ -546,6 +593,7 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstall) {
SuccessfullyLoad(GURL(kQuxWebAppUrl)); SuccessfullyLoad(GURL(kQuxWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetQuxAppInfo(), last_app_info());
EXPECT_EQ(GURL(kQuxWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kQuxWebAppUrl), install_callback_url());
ResetResults(); ResetResults();
...@@ -555,12 +603,14 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstall) { ...@@ -555,12 +603,14 @@ TEST_F(PendingBookmarkAppManagerTest, InstallApps_PendingInstall) {
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kFooWebAppUrl), install_callback_url());
EXPECT_EQ(GetFooAppInfo(), last_app_info());
ResetResults(); ResetResults();
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
...@@ -640,6 +690,7 @@ TEST_F(PendingBookmarkAppManagerTest, WebContentsLoadTimedOut) { ...@@ -640,6 +690,7 @@ TEST_F(PendingBookmarkAppManagerTest, WebContentsLoadTimedOut) {
SuccessfullyLoad(GURL(kBarWebAppUrl)); SuccessfullyLoad(GURL(kBarWebAppUrl));
EXPECT_FALSE(timer->IsRunning()); EXPECT_FALSE(timer->IsRunning());
EXPECT_TRUE(install_succeeded()); EXPECT_TRUE(install_succeeded());
EXPECT_EQ(GetBarAppInfo(), last_app_info());
EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url()); EXPECT_EQ(GURL(kBarWebAppUrl), install_callback_url());
} }
......
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