Commit ed18bdac authored by Basia Zimirska's avatar Basia Zimirska Committed by Chromium LUCI CQ

Unit tests for TranslateInfoBarDelegate

Bug: 1099438
Change-Id: I30fe2f19eb721b7de1eba4ce17d8c2d0c7e52bf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2605416
Commit-Queue: Basia Zimirska <basiaz@google.com>
Reviewed-by: default avatarScott Little <sclittle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841243}
parent 17da5559
......@@ -136,6 +136,10 @@ source_set("unit_tests") {
"//services/network/public/cpp:cpp",
"//ui/base",
]
if (is_ios || is_android) {
sources += [ "translate_infobar_delegate_unittest.cc" ]
}
}
source_set("test_support") {
......
......@@ -12,6 +12,7 @@
#include "components/infobars/core/infobar.h"
#include "components/translate/core/browser/translate_client.h"
#include "components/translate/core/browser/translate_driver.h"
#include "components/translate/core/browser/translate_infobar_delegate.h"
#include "components/translate/core/browser/translate_prefs.h"
#include "components/translate/core/common/language_detection_details.h"
#include "testing/gmock/include/gmock/gmock.h"
......@@ -40,11 +41,9 @@ class MockTranslateClient : public TranslateClient {
MOCK_CONST_METHOD0(GetInfobarIconID, int());
#if !defined(USE_AURA)
MOCK_CONST_METHOD1(CreateInfoBarMock,
infobars::InfoBar*(TranslateInfoBarDelegate*));
std::unique_ptr<infobars::InfoBar> CreateInfoBar(
std::unique_ptr<TranslateInfoBarDelegate> delegate) const {
return base::WrapUnique(CreateInfoBarMock(delegate.get()));
return std::make_unique<infobars::InfoBar>(std::move(delegate));
}
#endif
......
......@@ -248,7 +248,7 @@ class TranslateInfoBarDelegate : public infobars::InfoBarDelegate {
bool triggered_from_menu);
private:
friend class TranslationInfoBarTest;
friend class TranslateInfoBarDelegateTest;
typedef std::pair<std::string, base::string16> LanguageNamePair;
bool is_off_the_record_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment