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 #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 #include "net/test/test_server.h" |
11 | 11 |
12 class CommandLine; | 12 class CommandLine; |
13 | 13 |
14 class BrowserTestBase : public testing::Test { | 14 class BrowserTestBase : public testing::Test { |
15 public: | 15 public: |
16 BrowserTestBase(); | 16 BrowserTestBase(); |
17 virtual ~BrowserTestBase(); | 17 virtual ~BrowserTestBase(); |
18 | 18 |
19 // We do this so we can be used in a Task. | 19 // We do this so we can be used in a Task. |
20 void AddRef() {} | 20 void AddRef() {} |
21 void Release() {} | 21 void Release() {} |
22 static bool ImplementsThreadSafeReferenceCounting() { return false; } | |
23 | 22 |
24 // Configures everything for an in process browser test, then invokes | 23 // Configures everything for an in process browser test, then invokes |
25 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 24 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
26 virtual void SetUp() OVERRIDE; | 25 virtual void SetUp() OVERRIDE; |
27 | 26 |
28 // Restores state configured in SetUp. | 27 // Restores state configured in SetUp. |
29 virtual void TearDown() OVERRIDE; | 28 virtual void TearDown() OVERRIDE; |
30 | 29 |
31 // Override this to add any custom setup code that needs to be done on the | 30 // Override this to add any custom setup code that needs to be done on the |
32 // main thread after the browser is created and just before calling | 31 // main thread after the browser is created and just before calling |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void CreateTestServer(const char* test_server_base); | 69 void CreateTestServer(const char* test_server_base); |
71 | 70 |
72 private: | 71 private: |
73 void ProxyRunTestOnMainThreadLoop(); | 72 void ProxyRunTestOnMainThreadLoop(); |
74 | 73 |
75 // Testing server, started on demand. | 74 // Testing server, started on demand. |
76 scoped_ptr<net::TestServer> test_server_; | 75 scoped_ptr<net::TestServer> test_server_; |
77 }; | 76 }; |
78 | 77 |
79 #endif // CONTENT_TEST_BROWSER_TEST_BASE_H_ | 78 #endif // CONTENT_TEST_BROWSER_TEST_BASE_H_ |
OLD | NEW |