OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_function_test_utils.h" | 5 #include "chrome/browser/extensions/extension_function_test_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 function->set_dispatcher(dispatcher.AsWeakPtr()); | 217 function->set_dispatcher(dispatcher.AsWeakPtr()); |
218 | 218 |
219 function->set_profile(browser->profile()); | 219 function->set_profile(browser->profile()); |
220 function->set_include_incognito(flags & INCLUDE_INCOGNITO); | 220 function->set_include_incognito(flags & INCLUDE_INCOGNITO); |
221 function->Run(); | 221 function->Run(); |
222 | 222 |
223 // If the RunImpl of |function| didn't already call SendResponse, run the | 223 // If the RunImpl of |function| didn't already call SendResponse, run the |
224 // message loop until they do. | 224 // message loop until they do. |
225 if (!response_delegate.HasResponse()) { | 225 if (!response_delegate.HasResponse()) { |
226 response_delegate.set_should_post_quit(true); | 226 response_delegate.set_should_post_quit(true); |
227 ui_test_utils::RunMessageLoop(); | 227 content::RunMessageLoop(); |
228 } | 228 } |
229 | 229 |
230 EXPECT_TRUE(response_delegate.HasResponse()); | 230 EXPECT_TRUE(response_delegate.HasResponse()); |
231 return response_delegate.GetResponse(); | 231 return response_delegate.GetResponse(); |
232 } | 232 } |
233 | 233 |
234 } // namespace extension_function_test_utils | 234 } // namespace extension_function_test_utils |
OLD | NEW |