Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / extensions / api / declarative_content / declarative_content_condition_tracker_test.h
blob029706a9e0895234120c79cda6b5a60ad98ad891
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/test/base/testing_profile.h"
10 #include "content/public/browser/browser_context.h"
11 #include "content/public/browser/render_view_host.h"
12 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/test_browser_thread_bundle.h"
14 #include "content/public/test/test_renderer_host.h"
15 #include "testing/gtest/include/gtest/gtest.h"
17 namespace content {
18 class MockRenderProcessHost;
19 class WebContents;
20 } // namespace content
22 namespace extensions {
24 // Creates a TestWebContents browser context and mocks out RenderViewHosts. The
25 // latter is done to avoid having to run renderer processes and because the
26 // actual RenderViewHost implementation depends on things not available in this
27 // configuration.
28 class DeclarativeContentConditionTrackerTest : public testing::Test {
29 public:
30 DeclarativeContentConditionTrackerTest();
31 ~DeclarativeContentConditionTrackerTest() override;
33 protected:
34 // Creates a new WebContents and retains ownership.
35 scoped_ptr<content::WebContents> MakeTab();
37 // Gets the MockRenderProcessHost associated with a WebContents.
38 content::MockRenderProcessHost* GetMockRenderProcessHost(
39 content::WebContents* contents);
41 TestingProfile* profile() { return profile_.get(); }
43 const void* GeneratePredicateGroupID();
45 private:
46 content::TestBrowserThreadBundle thread_bundle_;
48 // Enables MockRenderProcessHosts.
49 content::RenderViewHostTestEnabler render_view_host_test_enabler_;
51 const scoped_ptr<TestingProfile> profile_;
53 uintptr_t next_predicate_group_id_;
55 DISALLOW_COPY_AND_ASSIGN(DeclarativeContentConditionTrackerTest);
58 } // namespace extensions
60 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_DECLARATIVE_CONTENT_CONDITION_TRACKER_TEST_H_