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

Unified Diff: chrome/renderer/translate/translate_script_browsertest.cc

Issue 378253002: Fix translate namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/renderer/translate/translate_script_browsertest.cc
diff --git a/chrome/renderer/translate/translate_script_browsertest.cc b/chrome/renderer/translate/translate_script_browsertest.cc
index 5f19df753275158261f634a4d7a4fdcdaf56a7fd..5de838b206606d8220865baa1a96b8cd9aae90f7 100644
--- a/chrome/renderer/translate/translate_script_browsertest.cc
+++ b/chrome/renderer/translate/translate_script_browsertest.cc
@@ -144,7 +144,7 @@ TEST_F(TranslateScriptBrowserTest, ElementLoadSuccess) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
}
// Test if onTranslateElementLoad() fails to initialize the element library and
@@ -155,7 +155,7 @@ TEST_F(TranslateScriptBrowserTest, ElementLoadFailure) {
InjectElementLibrary();
EXPECT_FALSE(IsLibReady());
EXPECT_TRUE(GetError());
- EXPECT_EQ(TranslateErrors::INITIALIZATION_ERROR, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::INITIALIZATION_ERROR, GetErrorCode());
}
// Test if cr.googleTranslate.translate() works.
@@ -163,12 +163,12 @@ TEST_F(TranslateScriptBrowserTest, TranslateSuccess) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
ExecuteScript(kTranslate);
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
}
// Test if cr.googleTranslate.translate() handles library exception correctly.
@@ -178,12 +178,13 @@ TEST_F(TranslateScriptBrowserTest, TranslateFail) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
ExecuteScript(kTranslate);
EXPECT_TRUE(GetError());
- EXPECT_EQ(TranslateErrors::UNEXPECTED_SCRIPT_ERROR, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::UNEXPECTED_SCRIPT_ERROR,
+ GetErrorCode());
}
// Test if onTranslateProgress callback handles boolean type error correctly.
@@ -194,12 +195,12 @@ TEST_F(TranslateScriptBrowserTest, CallbackGetBooleanError) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
ExecuteScript(kTranslate);
EXPECT_TRUE(GetError());
- EXPECT_EQ(TranslateErrors::TRANSLATION_ERROR, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::TRANSLATION_ERROR, GetErrorCode());
}
// Test if onTranslateProgress callback handles number type error correctly and
@@ -211,12 +212,12 @@ TEST_F(TranslateScriptBrowserTest, CallbackGetNumberError1) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
ExecuteScript(kTranslate);
EXPECT_TRUE(GetError());
- EXPECT_EQ(TranslateErrors::TRANSLATION_ERROR, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::TRANSLATION_ERROR, GetErrorCode());
}
// Test if onTranslateProgress callback handles number type error correctly and
@@ -228,12 +229,12 @@ TEST_F(TranslateScriptBrowserTest, CallbackGetNumberError2) {
InjectElementLibrary();
EXPECT_TRUE(IsLibReady());
EXPECT_FALSE(GetError());
- EXPECT_EQ(TranslateErrors::NONE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::NONE, GetErrorCode());
ExecuteScript(kTranslate);
EXPECT_TRUE(GetError());
- EXPECT_EQ(TranslateErrors::UNSUPPORTED_LANGUAGE, GetErrorCode());
+ EXPECT_EQ(translate::TranslateErrors::UNSUPPORTED_LANGUAGE, GetErrorCode());
}
// TODO(toyoshim): Add test for onLoadJavaScript.

Powered by Google App Engine
This is Rietveld 408576698