Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / test / content_browser_test.h
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 #ifndef CONTENT_TEST_CONTENT_BROWSER_TEST_H_
6 #define CONTENT_TEST_CONTENT_BROWSER_TEST_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/test/browser_test.h"
10 #include "content/public/test/browser_test_base.h"
11
12 class GURL;
13
14 namespace content {
15 class ContentRendererClient;
16 class Shell;
17 class ShellMainDelegate;
18
19 class ContentBrowserTest : public BrowserTestBase {
20  protected:
21   ContentBrowserTest();
22   virtual ~ContentBrowserTest();
23
24   // testing::Test:
25   virtual void SetUp() OVERRIDE;
26   virtual void TearDown() OVERRIDE;
27
28   // BrowserTestBase:
29   virtual void RunTestOnMainThreadLoop() OVERRIDE;
30
31   // Must be called before or during setup.
32   void SetContentRendererClient(
33       scoped_ptr<ContentRendererClient> renderer_client);
34
35  protected:
36   // Creates a new window and loads about:blank.
37   Shell* CreateBrowser();
38
39   // Creates an off-the-record window and loads about:blank.
40   Shell* CreateOffTheRecordBrowser();
41
42   // Returns the window for the test.
43   Shell* shell() const { return shell_; }
44
45  private:
46   scoped_ptr<ShellMainDelegate> shell_main_delegate_;
47
48   Shell* shell_;
49
50   bool setup_called_;
51
52   // ContentRendererClient when running in single-process mode.
53   scoped_ptr<ContentRendererClient> single_process_renderer_client_;
54 };
55
56 }  // namespace content
57
58 #endif  // CONTENT_TEST_CONTENT_BROWSER_TEST_H_