OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/profile_resetter/triggered_profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/triggered_profile_resetter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bit_cast.h" | 9 #include "base/bit_cast.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/prefs/pref_service.h" | |
13 #include "base/test/test_reg_util_win.h" | 12 #include "base/test/test_reg_util_win.h" |
14 #include "base/win/registry.h" | 13 #include "base/win/registry.h" |
15 #include "chrome/browser/prefs/browser_prefs.h" | 14 #include "chrome/browser/prefs/browser_prefs.h" |
16 #include "chrome/browser/profile_resetter/triggered_profile_resetter_factory.h" | 15 #include "chrome/browser/profile_resetter/triggered_profile_resetter_factory.h" |
17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
18 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "components/prefs/pref_service.h" |
19 #include "components/variations/entropy_provider.h" | 19 #include "components/variations/entropy_provider.h" |
20 #include "content/public/test/test_browser_thread_bundle.h" | 20 #include "content/public/test/test_browser_thread_bundle.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 using base::win::RegKey; | 23 using base::win::RegKey; |
24 | 24 |
25 class TriggeredProfileResetterTest : public testing::Test { | 25 class TriggeredProfileResetterTest : public testing::Test { |
26 protected: | 26 protected: |
27 void SetUp() override { | 27 void SetUp() override { |
28 override_manager_.OverrideRegistry(HKEY_CURRENT_USER); | 28 override_manager_.OverrideRegistry(HKEY_CURRENT_USER); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 const wchar_t kExpectedToolName[] = | 96 const wchar_t kExpectedToolName[] = |
97 L"ToolMcToolToolMcToolToolMcToolToolMcToolToolMcToolToolMcToolToolMcTool" | 97 L"ToolMcToolToolMcToolToolMcToolToolMcToolToolMcToolToolMcToolToolMcTool" |
98 L"ToolMcToolToolMcToolToolMcTool"; | 98 L"ToolMcToolToolMcToolToolMcTool"; |
99 SetRegTimestampAndToolName(kLongToolName, nullptr); | 99 SetRegTimestampAndToolName(kLongToolName, nullptr); |
100 TriggeredProfileResetter triggered_profile_resetter(&profile_); | 100 TriggeredProfileResetter triggered_profile_resetter(&profile_); |
101 triggered_profile_resetter.Activate(); | 101 triggered_profile_resetter.Activate(); |
102 EXPECT_TRUE(triggered_profile_resetter.HasResetTrigger()); | 102 EXPECT_TRUE(triggered_profile_resetter.HasResetTrigger()); |
103 EXPECT_STREQ(kExpectedToolName, | 103 EXPECT_STREQ(kExpectedToolName, |
104 triggered_profile_resetter.GetResetToolName().c_str()); | 104 triggered_profile_resetter.GetResetToolName().c_str()); |
105 } | 105 } |
OLD | NEW |