OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/browsing_data_ui/history_notice_utils.h" | 5 #include "components/browsing_data_ui/history_notice_utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 base::Unretained(this), | 99 base::Unretained(this), |
100 base::Unretained(&got_result))); | 100 base::Unretained(&got_result))); |
101 | 101 |
102 if (!got_result) { | 102 if (!got_result) { |
103 run_loop_.reset(new base::RunLoop()); | 103 run_loop_.reset(new base::RunLoop()); |
104 run_loop_->Run(); | 104 run_loop_->Run(); |
105 } | 105 } |
106 | 106 |
107 // Process the DeleteSoon() called on MergeBooleanCallbacks, otherwise | 107 // Process the DeleteSoon() called on MergeBooleanCallbacks, otherwise |
108 // this it will be considered to be leaked. | 108 // this it will be considered to be leaked. |
109 base::MessageLoop::current()->RunUntilIdle(); | 109 base::RunLoop().RunUntilIdle(); |
110 | 110 |
111 EXPECT_EQ(expected_test_case_result, result_); | 111 EXPECT_EQ(expected_test_case_result, result_); |
112 } | 112 } |
113 | 113 |
114 private: | 114 private: |
115 void Callback(bool* got_result, bool result) { | 115 void Callback(bool* got_result, bool result) { |
116 *got_result = true; | 116 *got_result = true; |
117 result_ = result; | 117 result_ = result; |
118 | 118 |
119 if (run_loop_) | 119 if (run_loop_) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Invalid responses from the web history are interpreted as false. | 178 // Invalid responses from the web history are interpreted as false. |
179 history_service()->SetWebAndAppActivityEnabled(true); | 179 history_service()->SetWebAndAppActivityEnabled(true); |
180 history_service()->SetOtherFormsOfBrowsingHistoryPresent(true); | 180 history_service()->SetOtherFormsOfBrowsingHistoryPresent(true); |
181 history_service()->SetupFakeResponse(true, net::HTTP_INTERNAL_SERVER_ERROR); | 181 history_service()->SetupFakeResponse(true, net::HTTP_INTERNAL_SERVER_ERROR); |
182 ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false); | 182 ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false); |
183 history_service()->SetupFakeResponse(false, net::HTTP_OK); | 183 history_service()->SetupFakeResponse(false, net::HTTP_OK); |
184 ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false); | 184 ExpectShouldPopupDialogAboutOtherFormsOfBrowsingHistoryWithResult(false); |
185 } | 185 } |
186 | 186 |
187 } // namespace browsing_data_ui | 187 } // namespace browsing_data_ui |
OLD | NEW |