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

Side by Side Diff: chrome/browser/translate/translate_manager_render_view_host_unittest.cc

Issue 225263017: Move TranslateManager::IsTranslatableURL to be a client-level concept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_manager.cc ('k') | chrome/browser/translate/translate_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698