| 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
|
|
|