| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/history/most_visited_tiles_experiment.h" | 5 #include "chrome/browser/history/most_visited_tiles_experiment.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/statistics_recorder.h" | 12 #include "base/metrics/statistics_recorder.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/history/history_types.h" | 15 #include "chrome/browser/history/history_types.h" |
| 16 #include "chrome/common/instant_types.h" | 16 #include "chrome/common/instant_types.h" |
| 17 #include "chrome/common/metrics/entropy_provider.h" | 17 #include "components/variations/entropy_provider.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 namespace history { | 21 namespace history { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Constants for the most visited tile placement field trial. | 25 // Constants for the most visited tile placement field trial. |
| 26 // See field trial config (MostVisitedTilePlacement.json) for details. | 26 // See field trial config (MostVisitedTilePlacement.json) for details. |
| 27 const char kMostVisitedFieldTrialName[] = "MostVisitedTilePlacement"; | 27 const char kMostVisitedFieldTrialName[] = "MostVisitedTilePlacement"; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 test_urls[TILE_ONE].url.spec()); | 349 test_urls[TILE_ONE].url.spec()); |
| 350 EXPECT_EQ(most_visited_urls[TILE_FOUR-1].url.spec(), | 350 EXPECT_EQ(most_visited_urls[TILE_FOUR-1].url.spec(), |
| 351 test_urls[TILE_FOUR-1].url.spec()); | 351 test_urls[TILE_FOUR-1].url.spec()); |
| 352 | 352 |
| 353 // Ensure counts are correct. | 353 // Ensure counts are correct. |
| 354 EXPECT_NO_FATAL_FAILURE( | 354 EXPECT_NO_FATAL_FAILURE( |
| 355 ValidateMetrics(NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_4)); | 355 ValidateMetrics(NTP_TILE_EXPERIMENT_ACTION_TOO_FEW_URLS_TILES_1_4)); |
| 356 } | 356 } |
| 357 | 357 |
| 358 } // namespace history | 358 } // namespace history |
| OLD | NEW |