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

Unified Diff: content/public/test/test_navigation_observer.h

Issue 12832004: content: Move all listeners of NOTIFICATION_RENDER_VIEW_HOST_CREATED out of content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/web_ui_browsertest.cc ('k') | content/public/test/test_navigation_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_navigation_observer.h
diff --git a/content/public/test/test_navigation_observer.h b/content/public/test/test_navigation_observer.h
index 70cda33b4f4869731cec546632e2b3b28dfcec6c..e7c2f8627a63c80a6a01e17322dbe30ff714a371 100644
--- a/content/public/test/test_navigation_observer.h
+++ b/content/public/test/test_navigation_observer.h
@@ -13,24 +13,12 @@
namespace content {
-class JsInjectionReadyObserver;
-
// For browser_tests, which run on the UI thread, run a second
-// MessageLoop and quit when the navigation completes loading. For
-// WebUI tests that need to inject javascript, construct with a
-// JsInjectionReadyObserver and this class will call its
-// OnJsInjectionReady() at the appropriate time.
+// MessageLoop and quit when the navigation completes loading.
class TestNavigationObserver : public NotificationObserver {
public:
- class RVHOSendJS;
-
- // Create and register a new TestNavigationObserver against the
- // |controller|. When |js_injection_ready_observer| is non-null, notify with
- // OnEntryCommitted() after |number_of_navigations| navigations.
- // Note: |js_injection_ready_observer| is owned by the caller and should be
- // valid until this class is destroyed.
+ // Create and register a new TestNavigationObserver against the |source|.
TestNavigationObserver(const NotificationSource& source,
- JsInjectionReadyObserver* js_injection_ready_observer,
int number_of_navigations);
// Like above but waits for one navigation.
explicit TestNavigationObserver(const NotificationSource& source);
@@ -44,21 +32,16 @@ class TestNavigationObserver : public NotificationObserver {
void Wait();
protected:
- // Note: |js_injection_ready_observer| is owned by the caller and should be
- // valid until this class is destroyed. Subclasses using this constructor MUST
- // call RegisterAsObserver when a NavigationController becomes available.
- explicit TestNavigationObserver(
- JsInjectionReadyObserver* js_injection_ready_observer,
- int number_of_navigations);
+ explicit TestNavigationObserver(int number_of_navigations);
// Register this TestNavigationObserver as an observer of the |source|.
void RegisterAsObserver(const NotificationSource& source);
- private:
// NotificationObserver:
virtual void Observe(int type, const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
+ private:
NotificationRegistrar registrar_;
// If true the navigation has started.
@@ -70,10 +53,6 @@ class TestNavigationObserver : public NotificationObserver {
// The number of navigations to wait for.
int number_of_navigations_;
- // Observer to take some action when the page is ready for JavaScript
- // injection.
- JsInjectionReadyObserver* js_injection_ready_observer_;
-
// |done_| will get set when this object observes a TabStripModel event.
bool done_;
@@ -84,10 +63,6 @@ class TestNavigationObserver : public NotificationObserver {
// |running_| will be true during WaitForObservation until |done_| is true.
bool running_;
- // |rvho_send_js_| will hold a RenderViewHostObserver subclass to allow
- // JavaScript injection at the appropriate time.
- scoped_ptr<RVHOSendJS> rvho_send_js_;
-
DISALLOW_COPY_AND_ASSIGN(TestNavigationObserver);
};
« no previous file with comments | « chrome/test/base/web_ui_browsertest.cc ('k') | content/public/test/test_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698