OLD | NEW |
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 Loading... |
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 |
OLD | NEW |