OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 // Now the message should have been sent. | 1439 // Now the message should have been sent. |
1440 int page_id = 0; | 1440 int page_id = 0; |
1441 std::string original_lang, target_lang; | 1441 std::string original_lang, target_lang; |
1442 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); | 1442 EXPECT_TRUE(GetTranslateMessage(&page_id, &original_lang, &target_lang)); |
1443 EXPECT_EQ("es", original_lang); | 1443 EXPECT_EQ("es", original_lang); |
1444 EXPECT_EQ("en", target_lang); | 1444 EXPECT_EQ("en", target_lang); |
1445 } | 1445 } |
1446 | 1446 |
1447 TEST_F(TranslateManagerRenderViewHostTest, DownloadsAndHistoryNotTranslated) { | 1447 TEST_F(TranslateManagerRenderViewHostTest, DownloadsAndHistoryNotTranslated) { |
1448 ASSERT_FALSE( | 1448 ASSERT_FALSE( |
1449 TranslateManager::IsTranslatableURL(GURL(chrome::kChromeUIDownloadsURL))); | 1449 TranslateService::IsTranslatableURL(GURL(chrome::kChromeUIDownloadsURL))); |
1450 ASSERT_FALSE( | 1450 ASSERT_FALSE( |
1451 TranslateManager::IsTranslatableURL(GURL(chrome::kChromeUIHistoryURL))); | 1451 TranslateService::IsTranslatableURL(GURL(chrome::kChromeUIHistoryURL))); |
1452 } | 1452 } |
1453 | 1453 |
1454 #if defined(USE_AURA) | 1454 #if defined(USE_AURA) |
1455 | 1455 |
1456 TEST_F(TranslateManagerRenderViewHostTest, BubbleNormalTranslate) { | 1456 TEST_F(TranslateManagerRenderViewHostTest, BubbleNormalTranslate) { |
1457 // Prepare for the bubble | 1457 // Prepare for the bubble |
1458 TranslateService::SetUseInfobar(false); | 1458 TranslateService::SetUseInfobar(false); |
1459 MockTranslateBubbleFactory* factory = new MockTranslateBubbleFactory; | 1459 MockTranslateBubbleFactory* factory = new MockTranslateBubbleFactory; |
1460 scoped_ptr<TranslateBubbleFactory> factory_ptr(factory); | 1460 scoped_ptr<TranslateBubbleFactory> factory_ptr(factory); |
1461 TranslateBubbleFactory::SetFactory(factory); | 1461 TranslateBubbleFactory::SetFactory(factory); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 // Check the bubble exists instead of the infobar. | 1547 // Check the bubble exists instead of the infobar. |
1548 TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); | 1548 TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); |
1549 ASSERT_TRUE(infobar == NULL); | 1549 ASSERT_TRUE(infobar == NULL); |
1550 TranslateBubbleModel* bubble = factory->model(); | 1550 TranslateBubbleModel* bubble = factory->model(); |
1551 ASSERT_TRUE(bubble != NULL); | 1551 ASSERT_TRUE(bubble != NULL); |
1552 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, | 1552 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, |
1553 bubble->GetViewState()); | 1553 bubble->GetViewState()); |
1554 } | 1554 } |
1555 | 1555 |
1556 #endif // defined(USE_AURA) | 1556 #endif // defined(USE_AURA) |
OLD | NEW |