| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/translate/translate_manager.h" | 5 #include "chrome/browser/translate/translate_manager.h" |
| 6 | 6 |
| 7 #include "content/public/common/url_constants.h" | 7 #include "content/public/common/url_constants.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 #ifdef FILE_MANAGER_EXTENSION | 11 #ifdef FILE_MANAGER_EXTENSION |
| 12 #include "chrome/browser/chromeos/extensions/file_manager/app_id.h" | 12 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 13 #include "extensions/common/constants.h" | 13 #include "extensions/common/constants.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 typedef testing::Test TranslateManagerTest; | 16 typedef testing::Test TranslateManagerTest; |
| 17 | 17 |
| 18 TEST_F(TranslateManagerTest, CheckTranslatableURL) { | 18 TEST_F(TranslateManagerTest, CheckTranslatableURL) { |
| 19 GURL empty_url = GURL(std::string()); | 19 GURL empty_url = GURL(std::string()); |
| 20 EXPECT_FALSE(TranslateManager::IsTranslatableURL(empty_url)); | 20 EXPECT_FALSE(TranslateManager::IsTranslatableURL(empty_url)); |
| 21 | 21 |
| 22 std::string chrome = std::string(chrome::kChromeUIScheme) + "://flags"; | 22 std::string chrome = std::string(chrome::kChromeUIScheme) + "://flags"; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 EXPECT_FALSE(TranslateManager::IsTranslatableURL(filemanager_url)); | 36 EXPECT_FALSE(TranslateManager::IsTranslatableURL(filemanager_url)); |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 std::string ftp = std::string(chrome::kFtpScheme) + "://google.com/pub"; | 39 std::string ftp = std::string(chrome::kFtpScheme) + "://google.com/pub"; |
| 40 GURL ftp_url = GURL(ftp); | 40 GURL ftp_url = GURL(ftp); |
| 41 EXPECT_FALSE(TranslateManager::IsTranslatableURL(ftp_url)); | 41 EXPECT_FALSE(TranslateManager::IsTranslatableURL(ftp_url)); |
| 42 | 42 |
| 43 GURL right_url = GURL("http://www.tamurayukari.com/"); | 43 GURL right_url = GURL("http://www.tamurayukari.com/"); |
| 44 EXPECT_TRUE(TranslateManager::IsTranslatableURL(right_url)); | 44 EXPECT_TRUE(TranslateManager::IsTranslatableURL(right_url)); |
| 45 } | 45 } |
| OLD | NEW |