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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/profile_resetter/profile_resetter.h" | 9 #include "chrome/browser/profile_resetter/profile_resetter.h" |
10 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" | 10 #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 explicit MockProfileResetter(TestingProfile* profile) | 24 explicit MockProfileResetter(TestingProfile* profile) |
25 : ProfileResetter(profile) { | 25 : ProfileResetter(profile) { |
26 } | 26 } |
27 | 27 |
28 bool IsActive() const override { | 28 bool IsActive() const override { |
29 return false; | 29 return false; |
30 } | 30 } |
31 | 31 |
32 void Reset(ResettableFlags resettable_flags, | 32 void Reset(ResettableFlags resettable_flags, |
33 scoped_ptr<BrandcodedDefaultSettings> master_settings, | 33 std::unique_ptr<BrandcodedDefaultSettings> master_settings, |
34 const base::Closure& callback) override { | 34 const base::Closure& callback) override { |
35 resets_++; | 35 resets_++; |
36 callback.Run(); | 36 callback.Run(); |
37 } | 37 } |
38 | 38 |
39 size_t resets() const { | 39 size_t resets() const { |
40 return resets_; | 40 return resets_; |
41 } | 41 } |
42 | 42 |
43 private: | 43 private: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 EXPECT_EQ(1u, handler()->resets()); | 94 EXPECT_EQ(1u, handler()->resets()); |
95 // Check that Javascript side is notified after resetting is done. | 95 // Check that Javascript side is notified after resetting is done. |
96 EXPECT_EQ("cr.webUIResponse", | 96 EXPECT_EQ("cr.webUIResponse", |
97 web_ui()->call_data()[0]->function_name()); | 97 web_ui()->call_data()[0]->function_name()); |
98 std::string callback_id; | 98 std::string callback_id; |
99 EXPECT_TRUE(web_ui()->call_data()[0]->arg1()->GetAsString(&callback_id)); | 99 EXPECT_TRUE(web_ui()->call_data()[0]->arg1()->GetAsString(&callback_id)); |
100 EXPECT_EQ(expected_callback_id, callback_id); | 100 EXPECT_EQ(expected_callback_id, callback_id); |
101 } | 101 } |
102 | 102 |
103 } // namespace | 103 } // namespace |
OLD | NEW |