Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / translate / translate_service_unittest.cc
blobfa9574c88b664e106b9b05acda583065e555d51f
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
3 // found in the LICENSE file.
5 #include "chrome/browser/translate/translate_service.h"
7 #include "content/public/common/url_constants.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "url/gurl.h"
11 #if defined(OS_CHROMEOS)
12 #include "chrome/browser/chromeos/file_manager/app_id.h"
13 #include "extensions/common/constants.h"
14 #endif
16 TEST(TranslateServiceTest, CheckTranslatableURL) {
17 GURL empty_url = GURL(std::string());
18 EXPECT_FALSE(TranslateService::IsTranslatableURL(empty_url));
20 std::string chrome = std::string(content::kChromeUIScheme) + "://flags";
21 GURL chrome_url = GURL(chrome);
22 EXPECT_FALSE(TranslateService::IsTranslatableURL(chrome_url));
24 std::string devtools = std::string(content::kChromeDevToolsScheme) + "://";
25 GURL devtools_url = GURL(devtools);
26 EXPECT_FALSE(TranslateService::IsTranslatableURL(devtools_url));
28 #if defined(OS_CHROMEOS)
29 std::string filemanager = std::string(extensions::kExtensionScheme) +
30 std::string("://") +
31 std::string(file_manager::kFileManagerAppId);
32 GURL filemanager_url = GURL(filemanager);
33 EXPECT_FALSE(TranslateService::IsTranslatableURL(filemanager_url));
34 #endif
36 std::string ftp = std::string(url::kFtpScheme) + "://google.com/pub";
37 GURL ftp_url = GURL(ftp);
38 EXPECT_FALSE(TranslateService::IsTranslatableURL(ftp_url));
40 GURL right_url = GURL("http://www.tamurayukari.com/");
41 EXPECT_TRUE(TranslateService::IsTranslatableURL(right_url));