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

Side by Side Diff: content/test/browser_test_base.h

Issue 10820007: Move all the layout tests that ran under browser_tests to run under content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 4 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
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 #ifndef CONTENT_TEST_BROWSER_TEST_BASE_H_ 5 #ifndef CONTENT_TEST_BROWSER_TEST_BASE_H_
6 #define CONTENT_TEST_BROWSER_TEST_BASE_H_ 6 #define CONTENT_TEST_BROWSER_TEST_BASE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "net/test/test_server.h"
10 11
11 class CommandLine; 12 class CommandLine;
12 13
13 class BrowserTestBase : public testing::Test { 14 class BrowserTestBase : public testing::Test {
14 public: 15 public:
15 BrowserTestBase(); 16 BrowserTestBase();
16 virtual ~BrowserTestBase(); 17 virtual ~BrowserTestBase();
17 18
18 // We do this so we can be used in a Task. 19 // We do this so we can be used in a Task.
19 void AddRef() {} 20 void AddRef() {}
(...skipping 29 matching lines...) Expand all
49 virtual void TearDownInProcessBrowserTestFixture() {} 50 virtual void TearDownInProcessBrowserTestFixture() {}
50 51
51 // Override this rather than TestBody. 52 // Override this rather than TestBody.
52 virtual void RunTestOnMainThread() = 0; 53 virtual void RunTestOnMainThread() = 0;
53 54
54 // This is invoked from main after browser_init/browser_main have completed. 55 // This is invoked from main after browser_init/browser_main have completed.
55 // This prepares for the test by creating a new browser, runs the test 56 // This prepares for the test by creating a new browser, runs the test
56 // (RunTestOnMainThread), quits the browsers and returns. 57 // (RunTestOnMainThread), quits the browsers and returns.
57 virtual void RunTestOnMainThreadLoop() = 0; 58 virtual void RunTestOnMainThreadLoop() = 0;
58 59
60 // Returns the testing server. Guaranteed to be non-NULL.
61 const net::TestServer* test_server() const { return test_server_.get(); }
62 net::TestServer* test_server() { return test_server_.get(); }
63
64 // This function is meant only for classes that directly derive from this
65 // class to construct the test server in their constructor. They might need to
66 // call this after setting up the paths. Actual test cases should never call
67 // this.
68 // |test_server_base| is the path, relative to src, to give to the test HTTP
69 // server.
70 void CreateTestServer(const char* test_server_base);
71
59 private: 72 private:
60 void ProxyRunTestOnMainThreadLoop(); 73 void ProxyRunTestOnMainThreadLoop();
74
75 // Testing server, started on demand.
76 scoped_ptr<net::TestServer> test_server_;
61 }; 77 };
62 78
63 #endif // CONTENT_TEST_BROWSER_TEST_BASE_H_ 79 #endif // CONTENT_TEST_BROWSER_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698