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/common/translate_util.h" | 5 #include "components/translate/core/common/translate_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/translate/core/common/translate_switches.h" | 8 #include "components/translate/core/common/translate_switches.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 language = std::string("en"); | 55 language = std::string("en"); |
56 translate::ToChromeLanguageSynonym(&language); | 56 translate::ToChromeLanguageSynonym(&language); |
57 EXPECT_EQ("en", language); | 57 EXPECT_EQ("en", language); |
58 } | 58 } |
59 | 59 |
60 TEST_F(TranslateUtilTest, SecurityOrigin) { | 60 TEST_F(TranslateUtilTest, SecurityOrigin) { |
61 GURL origin = translate::GetTranslateSecurityOrigin(); | 61 GURL origin = translate::GetTranslateSecurityOrigin(); |
62 EXPECT_EQ(std::string(translate::kSecurityOrigin), origin.spec()); | 62 EXPECT_EQ(std::string(translate::kSecurityOrigin), origin.spec()); |
63 | 63 |
64 const std::string running_origin("http://www.tamurayukari.com/"); | 64 const std::string running_origin("http://www.tamurayukari.com/"); |
65 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 65 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
66 command_line->AppendSwitchASCII(translate::switches::kTranslateSecurityOrigin, | 66 command_line->AppendSwitchASCII(translate::switches::kTranslateSecurityOrigin, |
67 running_origin); | 67 running_origin); |
68 GURL modified_origin = translate::GetTranslateSecurityOrigin(); | 68 GURL modified_origin = translate::GetTranslateSecurityOrigin(); |
69 EXPECT_EQ(running_origin, modified_origin.spec()); | 69 EXPECT_EQ(running_origin, modified_origin.spec()); |
70 } | 70 } |
OLD | NEW |