1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_DECLARATIVE_CONTENT_CONDITION_TRACKER_TEST_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_DECLARATIVE_CONTENT_CONDITION_TRACKER_TEST_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_delegate.h"
10 #include "chrome/test/base/testing_profile.h"
11 #include "content/public/browser/browser_context.h"
12 #include "content/public/browser/render_view_host.h"
13 #include "content/public/test/browser_test_utils.h"
14 #include "content/public/test/test_browser_thread_bundle.h"
15 #include "content/public/test/test_renderer_host.h"
16 #include "testing/gtest/include/gtest/gtest.h"
19 class MockRenderProcessHost
;
21 } // namespace content
23 namespace extensions
{
25 // Creates a TestWebContents browser context and mocks out RenderViewHosts. The
26 // latter is done to avoid having to run renderer processes and because the
27 // actual RenderViewHost implementation depends on things not available in this
29 class DeclarativeContentConditionTrackerTest
: public testing::Test
{
31 DeclarativeContentConditionTrackerTest();
32 ~DeclarativeContentConditionTrackerTest() override
;
35 // Creates a new WebContents and retains ownership.
36 scoped_ptr
<content::WebContents
> MakeTab();
38 // Gets the MockRenderProcessHost associated with a WebContents.
39 content::MockRenderProcessHost
* GetMockRenderProcessHost(
40 content::WebContents
* contents
);
42 TestingProfile
* profile() { return profile_
.get(); }
45 content::TestBrowserThreadBundle thread_bundle_
;
47 // Enables MockRenderProcessHosts.
48 content::RenderViewHostTestEnabler render_view_host_test_enabler_
;
50 const scoped_ptr
<TestingProfile
> profile_
;
52 DISALLOW_COPY_AND_ASSIGN(DeclarativeContentConditionTrackerTest
);
55 } // namespace extensions
57 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_DECLARATIVE_CONTENT_CONDITION_TRACKER_TEST_H_