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

Side by Side Diff: components/feature_engagement_tracker/internal/once_condition_validator_unittest.cc

Issue 2911123003: Metrics for feature engagement tracker. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/feature_engagement_tracker/internal/once_condition_validato r.h" 5 #include "components/feature_engagement_tracker/internal/once_condition_validato r.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "components/feature_engagement_tracker/internal/editable_configuration. h" 10 #include "components/feature_engagement_tracker/internal/editable_configuration. h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 .MeetsConditions(kTestFeatureBar, kValidFeatureConfig, model_, 105 .MeetsConditions(kTestFeatureBar, kValidFeatureConfig, model_,
106 availability_model_, 0u) 106 availability_model_, 0u)
107 .NoErrors()); 107 .NoErrors());
108 } 108 }
109 109
110 TEST_F(OnceConditionValidatorTest, OnlyTriggerWhenModelIsReady) { 110 TEST_F(OnceConditionValidatorTest, OnlyTriggerWhenModelIsReady) {
111 model_.SetIsReady(false); 111 model_.SetIsReady(false);
112 ConditionValidator::Result result = validator_.MeetsConditions( 112 ConditionValidator::Result result = validator_.MeetsConditions(
113 kTestFeatureFoo, kValidFeatureConfig, model_, availability_model_, 0u); 113 kTestFeatureFoo, kValidFeatureConfig, model_, availability_model_, 0u);
114 EXPECT_FALSE(result.NoErrors()); 114 EXPECT_FALSE(result.NoErrors());
115 EXPECT_FALSE(result.model_ready_ok); 115 EXPECT_FALSE(result.event_model_ready_ok);
116 116
117 model_.SetIsReady(true); 117 model_.SetIsReady(true);
118 EXPECT_TRUE(validator_ 118 EXPECT_TRUE(validator_
119 .MeetsConditions(kTestFeatureFoo, kValidFeatureConfig, model_, 119 .MeetsConditions(kTestFeatureFoo, kValidFeatureConfig, model_,
120 availability_model_, 0u) 120 availability_model_, 0u)
121 .NoErrors()); 121 .NoErrors());
122 } 122 }
123 123
124 TEST_F(OnceConditionValidatorTest, OnlyTriggerIfNothingElseIsShowing) { 124 TEST_F(OnceConditionValidatorTest, OnlyTriggerIfNothingElseIsShowing) {
125 validator_.NotifyIsShowing(kTestFeatureBar); 125 validator_.NotifyIsShowing(kTestFeatureBar);
(...skipping 15 matching lines...) Expand all
141 EXPECT_FALSE(result.NoErrors()); 141 EXPECT_FALSE(result.NoErrors());
142 EXPECT_FALSE(result.config_ok); 142 EXPECT_FALSE(result.config_ok);
143 143
144 EXPECT_TRUE(validator_ 144 EXPECT_TRUE(validator_
145 .MeetsConditions(kTestFeatureFoo, kValidFeatureConfig, model_, 145 .MeetsConditions(kTestFeatureFoo, kValidFeatureConfig, model_,
146 availability_model_, 0u) 146 availability_model_, 0u)
147 .NoErrors()); 147 .NoErrors());
148 } 148 }
149 149
150 } // namespace feature_engagement_tracker 150 } // namespace feature_engagement_tracker
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698