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

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

Issue 2106663004: arc: Initial implemetation of Chrome sync for Arc packages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wrap bridge state related method in unit_tests. Created 4 years, 5 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
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 313ffd93c522986fd1d242c8435e1254ac991684..01cecdf98f39fe8f4414ea7b27fb639012f81f38 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_test.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_test.cc
@@ -121,18 +121,36 @@ void ArcAppTest::SetUp(Profile* profile) {
// Check initial conditions.
EXPECT_EQ(bridge_service_.get(), arc::ArcBridgeService::Get());
- EXPECT_TRUE(!arc::ArcBridgeService::Get()->available());
+ EXPECT_FALSE(arc::ArcBridgeService::Get()->available());
EXPECT_FALSE(arc::ArcBridgeService::Get()->ready());
- // At this point we should have ArcAppListPrefs as observer of service.
- EXPECT_TRUE(bridge_service_->HasObserver(arc_app_list_pref_));
- bridge_service()->SetReady();
+ SetBridgeServiceReady();
}
void ArcAppTest::TearDown() {
auth_service_.reset();
}
+void ArcAppTest::SetBridgeServiceReady() {
+ bridge_service_->SetReady();
Luis Héctor Chávez 2016/07/25 17:31:17 Discussed offline, please try to not touch the bri
lgcheng 2016/07/25 20:45:17 Touch to bridge_service removed.
+}
+
+void ArcAppTest::SetBridgeServiceStopped() {
+ bridge_service_->app()->CloseChannel();
+ bridge_service_->SetStopped();
+}
+
+void ArcAppTest::ResetBridgeServiceReady() {
+ ResetAppInstance();
+ bridge_service_->SetReady();
+}
+
+void ArcAppTest::ResetAppInstance() {
+ bridge_service_->app()->CloseChannel();
+ app_instance_.reset(new arc::FakeAppInstance(arc_app_list_pref_));
+ bridge_service_->app()->SetInstance(app_instance_.get());
+}
+
const user_manager::User* ArcAppTest::CreateUserAndLogin() {
const AccountId account_id(AccountId::FromUserEmailGaiaId(
profile_->GetProfileUserName(), "1234567890"));

Powered by Google App Engine
This is Rietveld 408576698