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

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

Issue 305473005: Check browser's exit code in BrowserTestBase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 6 years, 6 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_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void TearDownInProcessBrowserTestFixture() {} 74 virtual void TearDownInProcessBrowserTestFixture() {}
75 75
76 // Override this rather than TestBody. 76 // Override this rather than TestBody.
77 virtual void RunTestOnMainThread() = 0; 77 virtual void RunTestOnMainThread() = 0;
78 78
79 // This is invoked from main after browser_init/browser_main have completed. 79 // This is invoked from main after browser_init/browser_main have completed.
80 // This prepares for the test by creating a new browser, runs the test 80 // This prepares for the test by creating a new browser, runs the test
81 // (RunTestOnMainThread), quits the browsers and returns. 81 // (RunTestOnMainThread), quits the browsers and returns.
82 virtual void RunTestOnMainThreadLoop() = 0; 82 virtual void RunTestOnMainThreadLoop() = 0;
83 83
84 // Sets expected browser exit code, in case it's different than 0 (success).
85 void set_expected_exit_code(int code) { expected_exit_code_ = code; }
86
84 // Returns the testing server. Guaranteed to be non-NULL. 87 // Returns the testing server. Guaranteed to be non-NULL.
85 // TODO(phajdan.jr): Remove test_server accessor (http://crbug.com/96594). 88 // TODO(phajdan.jr): Remove test_server accessor (http://crbug.com/96594).
86 const net::SpawnedTestServer* test_server() const { 89 const net::SpawnedTestServer* test_server() const {
87 return test_server_.get(); 90 return test_server_.get();
88 } 91 }
89 net::SpawnedTestServer* test_server() { return test_server_.get(); } 92 net::SpawnedTestServer* test_server() { return test_server_.get(); }
90 93
91 // Returns the embedded test server. Guaranteed to be non-NULL. 94 // Returns the embedded test server. Guaranteed to be non-NULL.
92 const net::test_server::EmbeddedTestServer* embedded_test_server() const { 95 const net::test_server::EmbeddedTestServer* embedded_test_server() const {
93 return embedded_test_server_.get(); 96 return embedded_test_server_.get();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 135
133 // Testing server, started on demand. 136 // Testing server, started on demand.
134 scoped_ptr<net::SpawnedTestServer> test_server_; 137 scoped_ptr<net::SpawnedTestServer> test_server_;
135 138
136 // Embedded test server, cheap to create, started on demand. 139 // Embedded test server, cheap to create, started on demand.
137 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; 140 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_;
138 141
139 // Host resolver used during tests. 142 // Host resolver used during tests.
140 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; 143 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_;
141 144
145 // Expected exit code (default is 0).
146 int expected_exit_code_;
147
142 // When true, the compositor will produce pixel output that can be read back 148 // When true, the compositor will produce pixel output that can be read back
143 // for pixel tests. 149 // for pixel tests.
144 bool enable_pixel_output_; 150 bool enable_pixel_output_;
145 151
146 // When true, do compositing with the software backend instead of using GL. 152 // When true, do compositing with the software backend instead of using GL.
147 bool use_software_compositing_; 153 bool use_software_compositing_;
148 154
149 #if defined(OS_POSIX) 155 #if defined(OS_POSIX)
150 bool handle_sigterm_; 156 bool handle_sigterm_;
151 #endif 157 #endif
152 }; 158 };
153 159
154 } // namespace content 160 } // namespace content
155 161
156 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ 162 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/first_run/try_chrome_dialog_view_browsertest.cc ('k') | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698