class Point;
}
+namespace net {
+namespace test_server {
+class EmbeddedTestServer;
+}
+}
+
// A collections of functions designed for use with content_browsertests and
// browser_tests.
// TO BE CLEAR: any function here must work against both binaries. If it only
// the test code has been executed but before performing assertions.
void FetchHistogramsFromChildProcesses();
+// Registers a request handler which redirects to a different host, based
+// on the request path. The format of the path should be
+// "/cross-site/hostname/rest/of/path" to redirect the request to
+// "<scheme>://hostname:<port>/rest/of/path", where <scheme> and <port>
+// are the values for the instance of EmbeddedTestServer.
+void SetupCrossSiteRedirector(
+ net::test_server::EmbeddedTestServer* embedded_test_server);
+
+// Waits for an interstitial page to attach to given web contents.
+void WaitForInterstitialAttach(content::WebContents* web_contents);
+
+// Waits for an interstitial page to detach from given web contents.
+void WaitForInterstitialDetach(content::WebContents* web_contents);
+
+// Runs task and waits for an interstitial page to detach from given web
+// contents. Prefer this over WaitForInterstitialDetach if web_contents may be
+// destroyed by the time WaitForInterstitialDetach is called (e.g. when waiting
+// for an interstitial detach after closing a tab).
+void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents,
+ const base::Closure& task);
+
// Watches title changes on a WebContents, blocking until an expected title is
// set.
class TitleWatcher : public WebContentsObserver {
// will wait for.
TitleWatcher(WebContents* web_contents,
const base::string16& expected_title);
- virtual ~TitleWatcher();
+ ~TitleWatcher() override;
// Adds another title to watch for.
void AlsoWaitForTitle(const base::string16& expected_title);
private:
// Overridden WebContentsObserver methods.
- virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE;
- virtual void TitleWasSet(NavigationEntry* entry, bool explicit_set) OVERRIDE;
+ void DidStopLoading(RenderViewHost* render_view_host) override;
+ void TitleWasSet(NavigationEntry* entry, bool explicit_set) override;
void TestTitle();
class WebContentsDestroyedWatcher : public WebContentsObserver {
public:
explicit WebContentsDestroyedWatcher(WebContents* web_contents);
- virtual ~WebContentsDestroyedWatcher();
+ ~WebContentsDestroyedWatcher() override;
// Waits until the WebContents is destroyed.
void Wait();
private:
// Overridden WebContentsObserver methods.
- virtual void WebContentsDestroyed() OVERRIDE;
+ void WebContentsDestroyed() override;
scoped_refptr<MessageLoopRunner> message_loop_runner_;
WatchType type);
// Waits for the render process that contains the specified web contents.
RenderProcessHostWatcher(WebContents* web_contents, WatchType type);
- virtual ~RenderProcessHostWatcher();
+ ~RenderProcessHostWatcher() override;
// Waits until the renderer process exits.
void Wait();
private:
// Overridden RenderProcessHost::LifecycleObserver methods.
- virtual void RenderProcessExited(RenderProcessHost* host,
- base::ProcessHandle handle,
- base::TerminationStatus status,
- int exit_code) OVERRIDE;
- virtual void RenderProcessHostDestroyed(RenderProcessHost* host) OVERRIDE;
+ void RenderProcessExited(RenderProcessHost* host,
+ base::TerminationStatus status,
+ int exit_code) override;
+ void RenderProcessHostDestroyed(RenderProcessHost* host) override;
RenderProcessHost* render_process_host_;
WatchType type_;
// DOMAutomationController. Do not construct this until the browser has
// started.
DOMMessageQueue();
- virtual ~DOMMessageQueue();
+ ~DOMMessageQueue() override;
// Removes all messages in the message queue.
void ClearQueue();
bool WaitForMessage(std::string* message) WARN_UNUSED_RESULT;
// Overridden NotificationObserver methods.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
+ void Observe(int type,
+ const NotificationSource& source,
+ const NotificationDetails& details) override;
private:
NotificationRegistrar registrar_;