Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1553)

Unified Diff: chrome/browser/extensions/extension_browsertests_misc.cc

Issue 150062: [chromium-reviews] Add getLanguage function to tabs extension (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_browsertests_misc.cc
===================================================================
--- chrome/browser/extensions/extension_browsertests_misc.cc (revision 20334)
+++ chrome/browser/extensions/extension_browsertests_misc.cc (working copy)
@@ -43,10 +43,10 @@
// Tests that toolstrips initializes properly and can run basic extension js.
IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, Toolstrip) {
- ASSERT_TRUE(LoadExtension(
- test_data_dir_.AppendASCII("good").AppendASCII("Extensions")
- .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
- .AppendASCII("1.0.0.0")));
+ FilePath extension_test_data_dir = test_data_dir_.AppendASCII("good").
+ AppendASCII("Extensions").AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj").
+ AppendASCII("1.0.0.0");
+ ASSERT_TRUE(LoadExtension(extension_test_data_dir));
// At this point, there should be two ExtensionHosts loaded because this
// extension has two toolstrips. Find the one that is hosting toolstrip1.html.
@@ -59,6 +59,22 @@
ui_test_utils::ExecuteJavaScriptAndExtractBool(
host->render_view_host(), L"", L"testTabsAPI()", &result);
EXPECT_TRUE(result);
+
+#if defined(OS_WIN)
+ // Test for compact language detection API. First navigate to a (static) html
+ // file with a French sentence. Then, run the test API in toolstrip1.html to
+ // actually call the language detection API through the existing extension,
+ // and verify that the language returned is indeed French.
+ FilePath language_url = extension_test_data_dir.AppendASCII(
+ "french_sentence.html");
+ ui_test_utils::NavigateToURL(
+ browser(),
+ GURL(language_url.ToWStringHack()));
+
+ ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ host->render_view_host(), L"", L"testTabsLanguageAPI()", &result);
+ EXPECT_TRUE(result);
+#endif
}
// Tests that the ExtensionShelf initializes properly, notices that

Powered by Google App Engine
This is Rietveld 408576698