Upstream version 11.39.256.0
[platform/framework/web/crosswalk.git] / src / xwalk / extensions / test / namespace_read_only.cc
index 545d264..8164aa3 100644 (file)
@@ -13,6 +13,7 @@
 #include "content/public/test/browser_test_utils.h"
 
 using xwalk::extensions::XWalkExtensionService;
+using xwalk::Runtime;
 
 class NamespaceReadOnlyExtensionTest : public XWalkExtensionsTestBase {
  public:
@@ -27,11 +28,12 @@ IN_PROC_BROWSER_TEST_F(NamespaceReadOnlyExtensionTest, NamespaceReadOnly) {
   GURL url = GetExtensionsTestURL(base::FilePath(),
                                   base::FilePath().AppendASCII(
                                       "namespace_read_only.html"));
-  content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString);
+  Runtime* runtime = CreateRuntime();
+  content::TitleWatcher title_watcher(runtime->web_contents(), kPassString);
   title_watcher.AlsoWaitForTitle(kFailString);
 
-  xwalk_test_utils::NavigateToURL(runtime(), url);
-  WaitForLoadStop(runtime()->web_contents());
+  xwalk_test_utils::NavigateToURL(runtime, url);
+  WaitForLoadStop(runtime->web_contents());
 
   EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle());
 }
@@ -40,11 +42,12 @@ IN_PROC_BROWSER_TEST_F(
     NamespaceReadOnlyExtensionTest, NamespaceReadOnlyAfterEntryPointCalled) {
   GURL url = GetExtensionsTestURL(base::FilePath(),
       base::FilePath().AppendASCII("namespace_read_only_with_entrypoint.html"));
-  content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString);
+  Runtime* runtime = CreateRuntime();
+  content::TitleWatcher title_watcher(runtime->web_contents(), kPassString);
   title_watcher.AlsoWaitForTitle(kFailString);
 
-  xwalk_test_utils::NavigateToURL(runtime(), url);
-  WaitForLoadStop(runtime()->web_contents());
+  xwalk_test_utils::NavigateToURL(runtime, url);
+  WaitForLoadStop(runtime->web_contents());
 
   EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle());
 }