X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fxwalk%2Fextensions%2Ftest%2Fexternal_extension.cc;h=a6f09bd265bb665e6f1fb3ac5385aa8b137bebef;hb=cd8c88ae33a568451d25f62aaa35bcf33252076c;hp=9ff4de16e9228984e58a66fef9b385fc2677831b;hpb=a5108fcda22462462a0c9692e802750284d31512;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/xwalk/extensions/test/external_extension.cc b/src/xwalk/extensions/test/external_extension.cc index 9ff4de1..a6f09bd 100644 --- a/src/xwalk/extensions/test/external_extension.cc +++ b/src/xwalk/extensions/test/external_extension.cc @@ -13,6 +13,7 @@ #include "content/public/test/test_utils.h" using xwalk::extensions::XWalkExtensionService; +using xwalk::Runtime; class ExternalExtensionTest : public XWalkExtensionsTestBase { public: @@ -43,81 +44,81 @@ class MultipleEntryPointsExtension : public XWalkExtensionsTestBase { }; IN_PROC_BROWSER_TEST_F(ExternalExtensionTest, ExternalExtension) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL(base::FilePath(), base::FilePath().AppendASCII("echo.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(ExternalExtensionTest, NavigateWithExternalExtension) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL(base::FilePath(), base::FilePath().AppendASCII("echo.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); for (int i = 0; i < 5; i++) { - 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()); } } IN_PROC_BROWSER_TEST_F(ExternalExtensionTest, ExternalExtensionSync) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL( base::FilePath(), base::FilePath().AppendASCII("sync_echo.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(RuntimeInterfaceTest, GetRuntimeVariable) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL( base::FilePath(), base::FilePath().AppendASCII("get_runtime_variable.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(MultipleEntryPointsExtension, MultipleEntryPoints) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL( base::FilePath(), base::FilePath().AppendASCII("entry_points.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(MultipleEntryPointsExtension, SetterLoadsExtension) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL( base::FilePath(), base::FilePath().AppendASCII("setter_callback_entry_point.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); } IN_PROC_BROWSER_TEST_F(MultipleEntryPointsExtension, ReplacementObjectIsUsed) { - content::RunAllPendingInMessageLoop(); + Runtime* runtime = CreateRuntime(); GURL url = GetExtensionsTestURL( base::FilePath(), base::FilePath().AppendASCII( "lazy_loaded_extension_overrides_object.html")); - content::TitleWatcher title_watcher(runtime()->web_contents(), kPassString); + content::TitleWatcher title_watcher(runtime->web_contents(), kPassString); title_watcher.AlsoWaitForTitle(kFailString); - xwalk_test_utils::NavigateToURL(runtime(), url); + xwalk_test_utils::NavigateToURL(runtime, url); EXPECT_EQ(kPassString, title_watcher.WaitAndGetTitle()); }