Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1347)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_test.cc

Issue 2322353002: [Merge-M53] arc: Add support of default and OEM apps. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_test.h ('k') | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/arc/arc_app_test.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_test.cc b/chrome/browser/ui/app_list/arc/arc_app_test.cc
index 5798eb230495d1b3f59c0047f4c39a26d7b4b0e2..fbb9818352bae6f0fd62af03c19b031671188cef 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_test.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_test.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_test.h"
#include "base/command_line.h"
+#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
@@ -30,6 +31,7 @@ std::string ArcAppTest::GetAppId(const arc::mojom::AppInfo& app_info) {
return ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity);
}
+// static
std::string ArcAppTest::GetAppId(const arc::mojom::ShortcutInfo& shortcut) {
return ArcAppListPrefs::GetAppId(shortcut.package_name, shortcut.intent_uri);
}
@@ -58,9 +60,9 @@ void ArcAppTest::SetUp(Profile* profile) {
profile_ = profile;
CreateUserAndLogin();
+ arc::mojom::AppInfo app;
// Make sure we have enough data for test.
for (int i = 0; i < 3; ++i) {
- arc::mojom::AppInfo app;
app.name = base::StringPrintf("Fake App %d", i);
app.package_name = base::StringPrintf("fake.app.%d", i);
app.activity = base::StringPrintf("fake.app.%d.activity", i);
@@ -69,6 +71,18 @@ void ArcAppTest::SetUp(Profile* profile) {
}
fake_apps_[0].sticky = true;
+ app.name = "TestApp1";
+ app.package_name = "test.app1";
+ app.activity = "test.app1.activity";
+ app.sticky = true;
+ fake_default_apps_.push_back(app);
+
+ app.name = "TestApp2";
+ app.package_name = "test.app2";
+ app.activity = "test.app2.activity";
+ app.sticky = true;
+ fake_default_apps_.push_back(app);
+
arc::mojom::ArcPackageInfo package1;
package1.package_name = kPackageName1;
package1.package_version = 1;
@@ -117,11 +131,14 @@ void ArcAppTest::SetUp(Profile* profile) {
DCHECK(arc::ArcAuthService::Get());
arc::ArcAuthService::DisableUIForTesting();
arc_auth_service()->OnPrimaryUserProfilePrepared(profile_);
- auth_service_->EnableArc();
arc_app_list_pref_ = ArcAppListPrefs::Get(profile_);
DCHECK(arc_app_list_pref_);
+ base::RunLoop run_loop;
+ arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure());
+ run_loop.Run();
+ auth_service_->EnableArc();
app_instance_.reset(new arc::FakeAppInstance(arc_app_list_pref_));
bridge_service_->app()->SetInstance(app_instance_.get());
}
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_test.h ('k') | chrome/browser/ui/app_list/arc/arc_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698