#include "content/public/test/browser_test_utils.h"
using xwalk::extensions::XWalkExtensionService;
+using xwalk::Runtime;
class NamespaceReadOnlyExtensionTest : public XWalkExtensionsTestBase {
public:
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());
}
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());
}