// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_TEST_WEB_CONTENTS_OBSERVER_CONSISTENCY_CHECKER_H_ #define CONTENT_TEST_WEB_CONTENTS_OBSERVER_CONSISTENCY_CHECKER_H_ #include <map> #include <set> #include <string> #include <vector> #include "base/memory/raw_ptr.h" #include "base/supports_user_data.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/media_player_id.h" #include "content/public/browser/web_contents_observer.h" namespace content { // If your test framework enables a ContentBrowserConsistencyChecker, this // consistency checker is automatically installed on all WebContentses during // your test. // // WebContentsObserverConsistencyChecker is a WebContentsObserver that checks // the consistency of observer calls, and CHECK()s if they are inconsistent. // These checks are test-only code designed to find bugs in the implementation // of the content layer by validating the contract between WebContents and its // observers. // // For example, WebContentsObserver::RenderFrameCreated announces the existence // of a new RenderFrameHost, so that method call must occur before the // RenderFrameHost is referenced by some other WebContentsObserver method. class WebContentsObserverConsistencyChecker : public WebContentsObserver, public base::SupportsUserData::Data { … }; } // namespace content #endif // CONTENT_TEST_WEB_CONTENTS_OBSERVER_CONSISTENCY_CHECKER_H_