Chromium Code Reviews| Index: chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc |
| diff --git a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc |
| index b36cc7059ed69f5338d422295081e54577ea5c6e..7308ed19c6e4395161bb754f3125115f9f43442f 100644 |
| --- a/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc |
| +++ b/chrome/browser/browsing_data/browsing_data_counter_utils_unittest.cc |
| @@ -7,10 +7,12 @@ |
| #include <string> |
| #include <vector> |
| +#include "base/message_loop/message_loop.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/browser/browsing_data/autofill_counter.h" |
| #include "chrome/test/base/testing_browser_process.h" |
| +#include "chrome/test/base/testing_profile.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #if defined(ENABLE_EXTENSIONS) |
| @@ -18,9 +20,29 @@ |
| #include "chrome/browser/browsing_data/hosted_apps_counter.h" |
| #endif |
| +class BrowsingDataCounterUtilsTest : public testing::Test { |
| + public: |
| + BrowsingDataCounterUtilsTest() : profile_(new TestingProfile()) {} |
| + |
| + ~BrowsingDataCounterUtilsTest() override {} |
| + |
| + void TearDown() override { |
| + profile_.reset(); |
| + base::MessageLoop::current()->RunUntilIdle(); |
| + } |
| + |
| + TestingProfile* GetProfile() { return profile_.get(); } |
| + |
| + private: |
| + base::MessageLoop loop_; |
| + std::unique_ptr<TestingProfile> profile_; |
| +}; |
| + |
| // Tests the complex output of the Autofill counter. |
| -TEST(BrowsingDataCounterUtilsTest, AutofillCounterResult) { |
| - AutofillCounter counter; |
| +TEST_F(BrowsingDataCounterUtilsTest, AutofillCounterResult) { |
| + // std::unique_ptr<Profile> profile_(new TestingProfile()); |
|
msramek
2016/06/27 12:46:18
Please remove the debugging comment.
ioanap
2016/06/27 14:50:43
Done.
|
| + |
| + AutofillCounter counter(GetProfile()); |
| // This test assumes that the strings are served exactly as defined, |
| // i.e. that the locale is set to the default "en". |
| @@ -68,8 +90,8 @@ TEST(BrowsingDataCounterUtilsTest, AutofillCounterResult) { |
| #if defined(ENABLE_EXTENSIONS) |
| // Tests the complex output of the hosted apps counter. |
| -TEST(BrowsingDataCounterUtilsTest, HostedAppsCounterResult) { |
| - HostedAppsCounter counter; |
| +TEST_F(BrowsingDataCounterUtilsTest, HostedAppsCounterResult) { |
| + HostedAppsCounter counter(GetProfile()); |
| // This test assumes that the strings are served exactly as defined, |
| // i.e. that the locale is set to the default "en". |