#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/types/cxx23_to_underlying.h"
#include "chrome/test/base/chrome_render_view_test.h"
#include "components/grit/components_resources.h"
#include "components/translate/core/common/translate_errors.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_script_source.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
WebScriptSource;
namespace {
const char kThrowInitializationError[] = …;
const char kThrowUnexpectedScriptError[] = …;
const char kCallbackReturnBooleanError[] = …;
const char kCallbackReturnNumberError[] = …;
const char kSetCallbackErrorCode[] = …;
const char kError[] = …;
const char kErrorCode[] = …;
const char kLibReady[] = …;
const char kTranslate[] = …;
const char kElementJs[] = …;
std::string GenerateSetCallbackErrorCodeScript(int code) { … }
}
class TranslateScriptBrowserTest : public ChromeRenderViewTest { … };
TEST_F(TranslateScriptBrowserTest, ElementLoadSuccess) { … }
TEST_F(TranslateScriptBrowserTest, ElementLoadFailure) { … }
TEST_F(TranslateScriptBrowserTest, TranslateSuccess) { … }
TEST_F(TranslateScriptBrowserTest, TranslateFail) { … }
TEST_F(TranslateScriptBrowserTest, CallbackGetBooleanError) { … }
TEST_F(TranslateScriptBrowserTest, CallbackGetNumberError1) { … }
TEST_F(TranslateScriptBrowserTest, CallbackGetNumberError2) { … }