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
3 // found in the LICENSE file.
5 #include "chrome/browser/translate/translate_manager.h"
7 #include "content/public/common/url_constants.h"
8 #include "testing/gtest/include/gtest/gtest.h"
11 #ifdef FILE_MANAGER_EXTENSION
12 #include "chrome/browser/chromeos/file_manager/app_id.h"
13 #include "extensions/common/constants.h"
16 typedef testing::Test TranslateManagerTest
;
18 TEST_F(TranslateManagerTest
, CheckTranslatableURL
) {
19 GURL empty_url
= GURL(std::string());
20 EXPECT_FALSE(TranslateManager::IsTranslatableURL(empty_url
));
22 std::string chrome
= std::string(chrome::kChromeUIScheme
) + "://flags";
23 GURL chrome_url
= GURL(chrome
);
24 EXPECT_FALSE(TranslateManager::IsTranslatableURL(chrome_url
));
26 std::string devtools
= std::string(chrome::kChromeDevToolsScheme
) + "://";
27 GURL devtools_url
= GURL(devtools
);
28 EXPECT_FALSE(TranslateManager::IsTranslatableURL(devtools_url
));
30 #ifdef FILE_MANAGER_EXTENSION
31 std::string filemanager
=
32 std::string(extensions::kExtensionScheme
) +
34 std::string(file_manager::kFileManagerAppId
);
35 GURL filemanager_url
= GURL(filemanager
);
36 EXPECT_FALSE(TranslateManager::IsTranslatableURL(filemanager_url
));
39 std::string ftp
= std::string(content::kFtpScheme
) + "://google.com/pub";
40 GURL ftp_url
= GURL(ftp
);
41 EXPECT_FALSE(TranslateManager::IsTranslatableURL(ftp_url
));
43 GURL right_url
= GURL("http://www.tamurayukari.com/");
44 EXPECT_TRUE(TranslateManager::IsTranslatableURL(right_url
));