OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/metrics/variations/variations_service.h" | 5 #include "chrome/browser/metrics/variations/variations_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 {0, 1, 0, 1, 0}, | 386 {0, 1, 0, 1, 0}, |
387 {0, 10, 0, 1, 0}, | 387 {0, 10, 0, 1, 0}, |
388 {0, 0, 1, 0, 1}, | 388 {0, 0, 1, 0, 1}, |
389 {0, 0, 10, 0, 1}, | 389 {0, 0, 10, 0, 1}, |
390 {0, 1, 1, 0, 1}, | 390 {0, 1, 1, 0, 1}, |
391 {1, 1, 1, 0, 1}, | 391 {1, 1, 1, 0, 1}, |
392 {1, 1, 0, 1, 0}, | 392 {1, 1, 0, 1, 0}, |
393 {1, 0, 1, 0, 1}, | 393 {1, 0, 1, 0, 1}, |
394 }; | 394 }; |
395 | 395 |
396 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { | 396 for (size_t i = 0; i < arraysize(cases); ++i) { |
397 TestVariationsServiceObserver observer; | 397 TestVariationsServiceObserver observer; |
398 service.AddObserver(&observer); | 398 service.AddObserver(&observer); |
399 | 399 |
400 variations::VariationsSeedSimulator::Result result; | 400 variations::VariationsSeedSimulator::Result result; |
401 result.normal_group_change_count = cases[i].normal_count; | 401 result.normal_group_change_count = cases[i].normal_count; |
402 result.kill_best_effort_group_change_count = cases[i].best_effort_count; | 402 result.kill_best_effort_group_change_count = cases[i].best_effort_count; |
403 result.kill_critical_group_change_count = cases[i].critical_count; | 403 result.kill_critical_group_change_count = cases[i].critical_count; |
404 service.NotifyObservers(result); | 404 service.NotifyObservers(result); |
405 | 405 |
406 EXPECT_EQ(cases[i].expected_best_effort_notifications, | 406 EXPECT_EQ(cases[i].expected_best_effort_notifications, |
407 observer.best_effort_changes_notified()) << i; | 407 observer.best_effort_changes_notified()) << i; |
408 EXPECT_EQ(cases[i].expected_crtical_notifications, | 408 EXPECT_EQ(cases[i].expected_crtical_notifications, |
409 observer.crticial_changes_notified()) << i; | 409 observer.crticial_changes_notified()) << i; |
410 | 410 |
411 service.RemoveObserver(&observer); | 411 service.RemoveObserver(&observer); |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 } // namespace chrome_variations | 415 } // namespace chrome_variations |
OLD | NEW |