Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 395783002: [DevTools] Move DevToolsWindow testing code to a separate class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, added cleanup to some tests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/prefs/pref_service.h" 21 #include "base/prefs/pref_service.h"
22 #include "base/strings/stringprintf.h" 22 #include "base/strings/stringprintf.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "base/test/test_timeouts.h" 24 #include "base/test/test_timeouts.h"
25 #include "base/time/time.h" 25 #include "base/time/time.h"
26 #include "base/values.h" 26 #include "base/values.h"
27 #include "chrome/browser/autocomplete/autocomplete_controller.h" 27 #include "chrome/browser/autocomplete/autocomplete_controller.h"
28 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 28 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
29 #include "chrome/browser/browser_process.h" 29 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/chrome_notification_types.h" 30 #include "chrome/browser/chrome_notification_types.h"
31 #include "chrome/browser/devtools/devtools_window.h"
32 #include "chrome/browser/extensions/extension_action.h" 31 #include "chrome/browser/extensions/extension_action.h"
33 #include "chrome/browser/history/history_service_factory.h" 32 #include "chrome/browser/history/history_service_factory.h"
34 #include "chrome/browser/profiles/profile.h" 33 #include "chrome/browser/profiles/profile.h"
35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" 34 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h"
36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 35 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
37 #include "chrome/browser/ui/browser.h" 36 #include "chrome/browser/ui/browser.h"
38 #include "chrome/browser/ui/browser_commands.h" 37 #include "chrome/browser/ui/browser_commands.h"
39 #include "chrome/browser/ui/browser_finder.h" 38 #include "chrome/browser/ui/browser_finder.h"
40 #include "chrome/browser/ui/browser_iterator.h" 39 #include "chrome/browser/ui/browser_iterator.h"
41 #include "chrome/browser/ui/browser_list.h" 40 #include "chrome/browser/ui/browser_list.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 const GURL& url, 260 const GURL& url,
262 int number_of_navigations) { 261 int number_of_navigations) {
263 NavigateToURLWithDispositionBlockUntilNavigationsComplete( 262 NavigateToURLWithDispositionBlockUntilNavigationsComplete(
264 browser, 263 browser,
265 url, 264 url,
266 number_of_navigations, 265 number_of_navigations,
267 CURRENT_TAB, 266 CURRENT_TAB,
268 BROWSER_TEST_WAIT_FOR_NAVIGATION); 267 BROWSER_TEST_WAIT_FOR_NAVIGATION);
269 } 268 }
270 269
271 void WaitUntilDevToolsWindowLoaded(DevToolsWindow* window) {
272 scoped_refptr<content::MessageLoopRunner> runner =
273 new content::MessageLoopRunner;
274 window->SetLoadCompletedCallback(runner->QuitClosure());
275 runner->Run();
276 }
277
278 base::FilePath GetTestFilePath(const base::FilePath& dir, 270 base::FilePath GetTestFilePath(const base::FilePath& dir,
279 const base::FilePath& file) { 271 const base::FilePath& file) {
280 base::FilePath path; 272 base::FilePath path;
281 PathService::Get(chrome::DIR_TEST_DATA, &path); 273 PathService::Get(chrome::DIR_TEST_DATA, &path);
282 return path.Append(dir).Append(file); 274 return path.Append(dir).Append(file);
283 } 275 }
284 276
285 GURL GetTestUrl(const base::FilePath& dir, const base::FilePath& file) { 277 GURL GetTestUrl(const base::FilePath& dir, const base::FilePath& file) {
286 return net::FilePathToFileURL(GetTestFilePath(dir, file)); 278 return net::FilePathToFileURL(GetTestFilePath(dir, file));
287 } 279 }
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 575
584 void HistoryEnumerator::HistoryQueryComplete( 576 void HistoryEnumerator::HistoryQueryComplete(
585 const base::Closure& quit_task, 577 const base::Closure& quit_task,
586 history::QueryResults* results) { 578 history::QueryResults* results) {
587 for (size_t i = 0; i < results->size(); ++i) 579 for (size_t i = 0; i < results->size(); ++i)
588 urls_.push_back((*results)[i].url()); 580 urls_.push_back((*results)[i].url());
589 quit_task.Run(); 581 quit_task.Run();
590 } 582 }
591 583
592 } // namespace ui_test_utils 584 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698