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

Side by Side Diff: content/public/test/content_browser_sanity_checker.cc

Issue 1137083005: Move ContentBrowserSanityChecker and WebContentsObserverSanityChecker from content/public/test to c… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2014 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 #include "content/public/test/content_browser_sanity_checker.h"
6
7 #include "base/bind.h"
8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/test/web_contents_observer_sanity_checker.h"
10
11 namespace content {
12
13 namespace {
14 bool g_sanity_checks_already_enabled = false;
15 }
16
17 ContentBrowserSanityChecker::ContentBrowserSanityChecker() {
18 CHECK(!g_sanity_checks_already_enabled)
19 << "Tried to enable ContentBrowserSanityChecker, but it's already been "
20 << "enabled.";
21 g_sanity_checks_already_enabled = true;
22
23 creation_hook_ =
24 base::Bind(&ContentBrowserSanityChecker::OnWebContentsCreated,
25 base::Unretained(this));
26 WebContentsImpl::FriendZone::AddCreatedCallbackForTesting(creation_hook_);
27 }
28
29 ContentBrowserSanityChecker::~ContentBrowserSanityChecker() {
30 WebContentsImpl::FriendZone::RemoveCreatedCallbackForTesting(creation_hook_);
31 g_sanity_checks_already_enabled = false;
32 }
33
34 void ContentBrowserSanityChecker::OnWebContentsCreated(
35 WebContents* web_contents) {
36 WebContentsObserverSanityChecker::Enable(web_contents);
37 }
38
39 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/content_browser_sanity_checker.h ('k') | content/public/test/test_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698