Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / push_messaging / push_messaging_canary_test.cc
index 077e79f..1be1505 100644 (file)
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/extension_set.h"
 #include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_frame_host.h"
+#include "extensions/common/extension_set.h"
+#include "extensions/test/result_catcher.h"
 #include "net/dns/mock_host_resolver.h"
 
 namespace {
@@ -73,7 +74,7 @@ class PushMessagingCanaryTest : public ExtensionApiTest {
   // InProcessBrowserTest override. Destroys the sync client and sync
   // profile created by the test.  We must clean up ProfileSyncServiceHarness
   // now before the profile is cleaned up.
-  virtual void CleanUpOnMainThread() OVERRIDE {
+  virtual void TearDownOnMainThread() OVERRIDE {
     sync_setup_helper_.reset();
   }
 
@@ -144,7 +145,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingCanaryTest, MANUAL_ReceivesPush) {
   ASSERT_TRUE(installed_extensions->Contains(kTestExtensionId));
 
   ResultCatcher catcher;
-  catcher.RestrictToProfile(profile());
+  catcher.RestrictToBrowserContext(profile());
 
   const Extension* extension =
       extension_service()->extensions()->GetByID(kTestExtensionId);
@@ -156,12 +157,12 @@ IN_PROC_BROWSER_TEST_F(PushMessagingCanaryTest, MANUAL_ReceivesPush) {
   const std::string& client_secret = sync_setup_helper()->client_secret();
   const std::string& refresh_token = sync_setup_helper()->refresh_token();
 
-  const string16& script_string = UTF8ToUTF16(base::StringPrintf(
+  const base::string16& script_string = base::UTF8ToUTF16(base::StringPrintf(
       "startTestWithCredentials('%s', '%s', '%s');",
       client_id.c_str(), client_secret.c_str(), refresh_token.c_str()));
 
-  browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost()->
-      ExecuteJavascriptInWebFrame(string16(), script_string);
+  browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()->
+      ExecuteJavaScript(script_string);
 
   EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
 }