chromium/chrome/browser/ui/views/translate/partial_translate_bubble_view_unittest.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/translate/partial_translate_bubble_view.h"

#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/ui/translate/partial_translate_bubble_model.h"
#include "chrome/browser/ui/translate/partial_translate_bubble_ui_action_logger.h"
#include "chrome/test/views/chrome_views_test_base.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/views/test/button_test_api.h"
#include "ui/views/widget/widget.h"

namespace {

class FakePartialTranslateBubbleModel : public PartialTranslateBubbleModel {};

}  // namespace

class PartialTranslateBubbleViewTest : public ChromeViewsTestBase {};

TEST_F(PartialTranslateBubbleViewTest,
       TargetLanguageTabDoesntTriggerTranslate) {}

TEST_F(PartialTranslateBubbleViewTest, TabSelectedAfterTranslation) {}

TEST_F(PartialTranslateBubbleViewTest, UpdateLanguageTabsFromResponse) {}

TEST_F(PartialTranslateBubbleViewTest, SourceLanguageTabUpdatesViewState) {}

// TODO(crbug.com/40848161): For some reason calling bubble_->TabSelectedAt(1)
// before bubble_->TabSelectedAt(0) in a test causes TabSelectedAt(0) to be
// run twice, resulting in the corresponding sample being logged twice. This
// does not happen in production. For now, test this logging separately to avoid
// encountering this issue in TabSelectedAfterTranslation.
TEST_F(PartialTranslateBubbleViewTest, SourceLanguageTabSelectedLogged) {}

TEST_F(PartialTranslateBubbleViewTest, TranslateFullPageButton) {}