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

Unified Diff: ios/chrome/browser/translate/translate_service_ios_unittest.cc

Issue 809333003: Upstream //ios/chrome/browser/translate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/translate/translate_service_ios_unittest.cc
diff --git a/ios/chrome/browser/translate/translate_service_ios_unittest.cc b/ios/chrome/browser/translate/translate_service_ios_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0cbd6b00331eec8d25561c8966e75a8e9a24c5b5
--- /dev/null
+++ b/ios/chrome/browser/translate/translate_service_ios_unittest.cc
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/translate/translate_service_ios.h"
+
+#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+#include "ios/public/test/test_chrome_provider_initializer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+TEST(TranslateServiceIOSTest, CheckTranslatableURL) {
+ // TODO(droger): Remove this once http://crbug.com/437332 is fixed.
+ ios::TestChromeProviderInitializer test_chrome_provider_initializer;
+
+ GURL empty_url = GURL(std::string());
+ EXPECT_FALSE(TranslateServiceIOS::IsTranslatableURL(empty_url));
+
+ std::string chrome =
+ std::string(ios::GetChromeBrowserProvider()->GetChromeUIScheme()) +
+ "://flags";
+ GURL chrome_url = GURL(chrome);
+ EXPECT_FALSE(TranslateServiceIOS::IsTranslatableURL(chrome_url));
+
+ GURL right_url = GURL("http://www.tamurayukari.com/");
+ EXPECT_TRUE(TranslateServiceIOS::IsTranslatableURL(right_url));
+}

Powered by Google App Engine
This is Rietveld 408576698