Index: content/public/test/test_navigation_observer.cc |
diff --git a/content/public/test/test_navigation_observer.cc b/content/public/test/test_navigation_observer.cc |
index 590d8a73959d6fb23f81828bdd48c653d2f1edb5..970d82d80f9fff3361fa713d2f4b1780ce6d7d6c 100644 |
--- a/content/public/test/test_navigation_observer.cc |
+++ b/content/public/test/test_navigation_observer.cc |
@@ -9,52 +9,19 @@ |
#include "base/run_loop.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_types.h" |
-#include "content/public/browser/render_view_host_observer.h" |
-#include "content/public/test/js_injection_ready_observer.h" |
#include "content/public/test/test_utils.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace content { |
-// This class observes |render_view_host| and calls OnJsInjectionReady() of |
-// |js_injection_ready_observer| when the time is right to inject JavaScript |
-// into the page. |
-class TestNavigationObserver::RVHOSendJS : public RenderViewHostObserver { |
- public: |
- RVHOSendJS(RenderViewHost* render_view_host, |
- JsInjectionReadyObserver* js_injection_ready_observer) |
- : RenderViewHostObserver(render_view_host), |
- js_injection_ready_observer_(js_injection_ready_observer) { |
- } |
- |
- private: |
- // RenderViewHostObserver implementation. |
- virtual void RenderViewHostInitialized() OVERRIDE { |
- if (js_injection_ready_observer_) |
- js_injection_ready_observer_->OnJsInjectionReady(render_view_host()); |
- } |
- |
- JsInjectionReadyObserver* js_injection_ready_observer_; |
- |
- DISALLOW_COPY_AND_ASSIGN(RVHOSendJS); |
-}; |
- |
TestNavigationObserver::TestNavigationObserver( |
const NotificationSource& source, |
- JsInjectionReadyObserver* js_injection_ready_observer, |
int number_of_navigations) |
: navigation_started_(false), |
navigations_completed_(0), |
number_of_navigations_(number_of_navigations), |
- js_injection_ready_observer_(js_injection_ready_observer), |
done_(false), |
running_(false) { |
- // When javascript injection is requested, register for RenderViewHost |
- // creation. |
- if (js_injection_ready_observer_) { |
- registrar_.Add(this, NOTIFICATION_RENDER_VIEW_HOST_CREATED, |
- NotificationService::AllSources()); |
- } |
RegisterAsObserver(source); |
} |
@@ -63,7 +30,6 @@ TestNavigationObserver::TestNavigationObserver( |
: navigation_started_(false), |
navigations_completed_(0), |
number_of_navigations_(1), |
- js_injection_ready_observer_(NULL), |
done_(false), |
running_(false) { |
RegisterAsObserver(source); |
@@ -93,20 +59,12 @@ void TestNavigationObserver::Wait() { |
} |
TestNavigationObserver::TestNavigationObserver( |
- JsInjectionReadyObserver* js_injection_ready_observer, |
int number_of_navigations) |
: navigation_started_(false), |
navigations_completed_(0), |
number_of_navigations_(number_of_navigations), |
- js_injection_ready_observer_(js_injection_ready_observer), |
done_(false), |
running_(false) { |
- // When javascript injection is requested, register for RenderViewHost |
- // creation. |
- if (js_injection_ready_observer_) { |
- registrar_.Add(this, NOTIFICATION_RENDER_VIEW_HOST_CREATED, |
- NotificationService::AllSources()); |
- } |
} |
void TestNavigationObserver::RegisterAsObserver( |
@@ -138,11 +96,6 @@ void TestNavigationObserver::Observe( |
} |
} |
break; |
- case NOTIFICATION_RENDER_VIEW_HOST_CREATED: |
- rvho_send_js_.reset(new RVHOSendJS( |
- Source<RenderViewHost>(source).ptr(), |
- js_injection_ready_observer_)); |
- break; |
default: |
NOTREACHED(); |
} |