Index: content/public/test/javascript_test_observer.cc |
diff --git a/chrome/test/base/javascript_test_observer.cc b/content/public/test/javascript_test_observer.cc |
similarity index 77% |
rename from chrome/test/base/javascript_test_observer.cc |
rename to content/public/test/javascript_test_observer.cc |
index d010b93dcfae86216108c1135e0b2ea953e3ccfd..eabf2b457df060aead75151c7c9aea395f9d7db4 100644 |
--- a/chrome/test/base/javascript_test_observer.cc |
+++ b/content/public/test/javascript_test_observer.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/test/base/javascript_test_observer.h" |
+#include "content/public/test/javascript_test_observer.h" |
#include "content/public/browser/dom_operation_notification_details.h" |
#include "content/public/browser/notification_types.h" |
@@ -10,6 +10,8 @@ |
#include "content/public/browser/web_contents.h" |
#include "content/public/test/test_utils.h" |
+namespace content { |
+ |
TestMessageHandler::TestMessageHandler() : ok_(true) { |
} |
@@ -27,15 +29,14 @@ void TestMessageHandler::Reset() { |
} |
JavascriptTestObserver::JavascriptTestObserver( |
- content::WebContents* web_contents, |
- TestMessageHandler* handler) |
+ WebContents* web_contents, TestMessageHandler* handler) |
: handler_(handler), |
running_(false), |
finished_(false) { |
Reset(); |
registrar_.Add(this, |
- content::NOTIFICATION_DOM_OPERATION_RESPONSE, |
- content::Source<content::WebContents>(web_contents)); |
+ NOTIFICATION_DOM_OPERATION_RESPONSE, |
+ Source<WebContents>(web_contents)); |
} |
JavascriptTestObserver::~JavascriptTestObserver() { |
@@ -46,7 +47,7 @@ bool JavascriptTestObserver::Run() { |
if (!finished_) { |
CHECK(!running_); |
running_ = true; |
- content::RunMessageLoop(); |
+ RunMessageLoop(); |
running_ = false; |
} |
return handler_->ok(); |
@@ -61,11 +62,10 @@ void JavascriptTestObserver::Reset() { |
void JavascriptTestObserver::Observe( |
int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) { |
- CHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); |
- content::Details<content::DomOperationNotificationDetails> dom_op_details( |
- details); |
+ const NotificationSource& source, |
+ const NotificationDetails& details) { |
+ CHECK(type == NOTIFICATION_DOM_OPERATION_RESPONSE); |
+ Details<DomOperationNotificationDetails> dom_op_details(details); |
// We might receive responses for other script execution, but we only |
// care about the test finished message. |
TestMessageHandler::MessageResponse response = |
@@ -88,3 +88,5 @@ void JavascriptTestObserver::EndTest() { |
base::MessageLoopForUI::current()->Quit(); |
} |
} |
+ |
+} // namespace content |