| 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 "components/translate/core/browser/translate_prefs.h" |    5 #include "components/translate/core/browser/translate_prefs.h" | 
|    6  |    6  | 
|    7 #include <algorithm> |    7 #include <algorithm> | 
|    8 #include <string> |    8 #include <string> | 
|    9 #include <vector> |    9 #include <vector> | 
|   10  |   10  | 
|   11 #include "components/translate/core/browser/translate_download_manager.h" |   11 #include "components/translate/core/browser/translate_download_manager.h" | 
|   12 #include "testing/gtest/include/gtest/gtest.h" |   12 #include "testing/gtest/include/gtest/gtest.h" | 
|   13  |   13  | 
 |   14 namespace translate { | 
 |   15  | 
|   14 TEST(TranslatePrefsTest, CreateBlockedLanguages) { |   16 TEST(TranslatePrefsTest, CreateBlockedLanguages) { | 
|   15   TranslateDownloadManager::GetInstance()->set_application_locale("en"); |   17   TranslateDownloadManager::GetInstance()->set_application_locale("en"); | 
|   16   std::vector<std::string> blacklisted_languages; |   18   std::vector<std::string> blacklisted_languages; | 
|   17   blacklisted_languages.push_back("en"); |   19   blacklisted_languages.push_back("en"); | 
|   18   blacklisted_languages.push_back("fr"); |   20   blacklisted_languages.push_back("fr"); | 
|   19   // Hebrew: synonym to 'he' |   21   // Hebrew: synonym to 'he' | 
|   20   blacklisted_languages.push_back("iw"); |   22   blacklisted_languages.push_back("iw"); | 
|   21   // Haitian is not used as Accept-Language |   23   // Haitian is not used as Accept-Language | 
|   22   blacklisted_languages.push_back("ht"); |   24   blacklisted_languages.push_back("ht"); | 
|   23  |   25  | 
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  111     EXPECT_EQ(expected.size(), blocked_languages.size()); |  113     EXPECT_EQ(expected.size(), blocked_languages.size()); | 
|  112     for (std::vector<std::string>::const_iterator it = expected.begin(); |  114     for (std::vector<std::string>::const_iterator it = expected.begin(); | 
|  113          it != expected.end(); ++it) { |  115          it != expected.end(); ++it) { | 
|  114       EXPECT_NE(blocked_languages.end(), |  116       EXPECT_NE(blocked_languages.end(), | 
|  115                 std::find(blocked_languages.begin(), |  117                 std::find(blocked_languages.begin(), | 
|  116                           blocked_languages.end(), |  118                           blocked_languages.end(), | 
|  117                           *it)); |  119                           *it)); | 
|  118     } |  120     } | 
|  119   } |  121   } | 
|  120 } |  122 } | 
 |  123  | 
 |  124 }  // namespace translate | 
| OLD | NEW |