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

Side by Side Diff: components/arc/intent_helper/arc_intent_helper_bridge_unittest.cc

Issue 2556463003: Use mojo typemaps to simplify arc::IntentFilter::IntentFilter() (reland) (Closed)
Patch Set: Rebased Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" 5 #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "components/arc/common/intent_helper.mojom.h" 9 #include "components/arc/common/intent_helper.mojom.h"
10 #include "components/arc/intent_helper/activity_icon_loader.h" 10 #include "components/arc/intent_helper/activity_icon_loader.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 void Reset() { updated_ = false; } 147 void Reset() { updated_ = false; }
148 148
149 private: 149 private:
150 bool updated_ = false; 150 bool updated_ = false;
151 }; 151 };
152 152
153 // Observer should be called when intent filter is updated. 153 // Observer should be called when intent filter is updated.
154 auto observer = base::MakeUnique<FakeObserver>(); 154 auto observer = base::MakeUnique<FakeObserver>();
155 instance_->AddObserver(observer.get()); 155 instance_->AddObserver(observer.get());
156 EXPECT_FALSE(observer->IsUpdated()); 156 EXPECT_FALSE(observer->IsUpdated());
157 instance_->OnIntentFiltersUpdated(std::vector<mojom::IntentFilterPtr>()); 157 instance_->OnIntentFiltersUpdated(std::vector<IntentFilter>());
158 EXPECT_TRUE(observer->IsUpdated()); 158 EXPECT_TRUE(observer->IsUpdated());
159 159
160 // Observer should not be called after it's removed. 160 // Observer should not be called after it's removed.
161 observer->Reset(); 161 observer->Reset();
162 instance_->RemoveObserver(observer.get()); 162 instance_->RemoveObserver(observer.get());
163 instance_->OnIntentFiltersUpdated(std::vector<mojom::IntentFilterPtr>()); 163 instance_->OnIntentFiltersUpdated(std::vector<IntentFilter>());
164 EXPECT_FALSE(observer->IsUpdated()); 164 EXPECT_FALSE(observer->IsUpdated());
165 } 165 }
166 166
167 } // namespace arc 167 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | components/arc/intent_helper/intent_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698