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

Side by Side Diff: content/test/content_browser_test_utils.cc

Issue 10803026: Get content_browsertest working. I've added a simple test for now, and will convert the tests in sr… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get it working on mac + linux, fix unittests crash, and fix unittest link error and add missing dep… Created 8 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 | « content/test/content_browser_test_utils.h ('k') | content/test/content_test_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/test/content_browser_test_utils.h"
6
7 #include "base/bind.h"
8 #include "base/file_path.h"
9 #include "base/path_service.h"
10 #include "base/run_loop.h"
11 #include "content/public/browser/navigation_controller.h"
12 #include "content/public/browser/notification_source.h"
13 #include "content/public/browser/web_contents.h"
14 #include "content/public/common/content_paths.h"
15 #include "content/public/test/browser_test_utils.h"
16 #include "content/public/test/test_navigation_observer.h"
17 #include "content/shell/shell.h"
18 #include "net/base/net_util.h"
19
20 namespace content {
21
22 FilePath GetTestFilePath(const char* dir, const char* file) {
23 FilePath path;
24 PathService::Get(DIR_TEST_DATA, &path);
25 return path.Append(
26 FilePath().AppendASCII(dir).Append(FilePath().AppendASCII(file)));
27 }
28
29 GURL GetTestUrl(const char* dir, const char* file) {
30 return net::FilePathToFileURL(GetTestFilePath(dir, file));
31 }
32
33 void NavigateToURL(Shell* window, const GURL& url) {
34 NavigationController* controller = &window->web_contents()->GetController();
35 TestNavigationObserver same_tab_observer(
36 Source<NavigationController>(controller),
37 NULL,
38 1);
39
40 window->LoadURL(url);
41
42 base::RunLoop run_loop;
43 same_tab_observer.WaitForObservation(
44 base::Bind(&RunThisRunLoop, base::Unretained(&run_loop)),
45 GetQuitTaskForRunLoop(&run_loop));
46 }
47
48 } // namespace content
OLDNEW
« no previous file with comments | « content/test/content_browser_test_utils.h ('k') | content/test/content_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698