X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fchromeos%2Ffile_manager%2Ffile_tasks_unittest.cc;h=8c3caf4d5e7f95bf53cae2d396d11ee5361831c1;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=c1b184f5fe8c229696b2466904456812bd6b4303;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc b/src/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc index c1b184f..8c3caf4 100644 --- a/src/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc +++ b/src/chrome/browser/chromeos/file_manager/file_tasks_unittest.cc @@ -18,11 +18,11 @@ #include "chrome/browser/chromeos/settings/device_settings_service.h" #include "chrome/browser/drive/drive_app_registry.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread_bundle.h" +#include "extensions/browser/extension_system.h" #include "extensions/common/extension_builder.h" #include "google_apis/drive/drive_api_parser.h" #include "testing/gtest/include/gtest/gtest.h" @@ -167,13 +167,13 @@ TEST(FileManagerFileTasksTest, ParseTaskID_UnknownTaskType) { } TEST(FileManagerFileTasksTest, FindDriveAppTasks) { + TestingProfile profile; // For DriveAppRegistry, which checks CurrentlyOn(BrowserThread::UI). content::TestBrowserThreadBundle thread_bundle; // Foo.app can handle "text/plain" and "text/html" scoped_ptr foo_app(new google_apis::AppResource); - foo_app->set_product_url( - GURL("https://chrome.google.com/webstore/detail/foo_app_id")); + foo_app->set_product_id("foo_app_id"); foo_app->set_application_id("foo_app_id"); foo_app->set_name("Foo"); foo_app->set_object_type("foo_object_type"); @@ -184,8 +184,7 @@ TEST(FileManagerFileTasksTest, FindDriveAppTasks) { // Bar.app can only handle "text/plain". scoped_ptr bar_app(new google_apis::AppResource); - bar_app->set_product_url( - GURL("https://chrome.google.com/webstore/detail/bar_app_id")); + bar_app->set_product_id("bar_app_id"); bar_app->set_application_id("bar_app_id"); bar_app->set_name("Bar"); bar_app->set_object_type("bar_object_type"); @@ -206,7 +205,7 @@ TEST(FileManagerFileTasksTest, FindDriveAppTasks) { PathAndMimeTypeSet path_mime_set; path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.txt"), + drive::util::GetDriveMountPointPath(&profile).AppendASCII("foo.txt"), "text/plain")); std::vector tasks; FindDriveAppTasks(drive_app_registry, @@ -227,11 +226,11 @@ TEST(FileManagerFileTasksTest, FindDriveAppTasks) { path_mime_set.clear(); path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.txt"), + drive::util::GetDriveMountPointPath(&profile).AppendASCII("foo.txt"), "text/plain")); path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.html"), + drive::util::GetDriveMountPointPath(&profile).AppendASCII("foo.html"), "text/html")); tasks.clear(); FindDriveAppTasks(drive_app_registry, @@ -434,7 +433,8 @@ TEST_F(FileManagerFileTasksComplexTest, FindFileHandlerTasks) { PathAndMimeTypeSet path_mime_set; path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.txt"), + drive::util::GetDriveMountPointPath(&test_profile_).AppendASCII( + "foo.txt"), "text/plain")); std::vector tasks; @@ -454,11 +454,13 @@ TEST_F(FileManagerFileTasksComplexTest, FindFileHandlerTasks) { path_mime_set.clear(); path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.txt"), + drive::util::GetDriveMountPointPath(&test_profile_).AppendASCII( + "foo.txt"), "text/plain")); path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.html"), + drive::util::GetDriveMountPointPath(&test_profile_).AppendASCII( + "foo.html"), "text/html")); tasks.clear(); FindFileHandlerTasks(&test_profile_, path_mime_set, &tasks); @@ -606,8 +608,7 @@ TEST_F(FileManagerFileTasksComplexTest, FindAllTypesOfTasks) { // Baz.app can handle "text/plain". // This is a Drive app. scoped_ptr baz_app(new google_apis::AppResource); - baz_app->set_product_url( - GURL("https://chrome.google.com/webstore/detail/baz_app_id")); + baz_app->set_product_id("baz_app_id"); baz_app->set_application_id(kBazId); baz_app->set_name("Baz"); baz_app->set_object_type("baz_object_type"); @@ -627,7 +628,8 @@ TEST_F(FileManagerFileTasksComplexTest, FindAllTypesOfTasks) { std::vector file_urls; path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.txt"), + drive::util::GetDriveMountPointPath(&test_profile_).AppendASCII( + "foo.txt"), "text/plain")); file_urls.push_back(GURL("filesystem:chrome-extension://id/dir/foo.txt")); @@ -658,8 +660,7 @@ TEST_F(FileManagerFileTasksComplexTest, FindAllTypesOfTasks_GoogleDocument) { // Foo.app can handle ".gdoc" files. scoped_ptr foo_app(new google_apis::AppResource); - foo_app->set_product_url( - GURL("https://chrome.google.com/webstore/detail/foo_app")); + foo_app->set_product_id("foo_app"); foo_app->set_application_id(kFooId); foo_app->set_name("Foo"); foo_app->set_object_type("foo_object_type"); @@ -718,7 +719,8 @@ TEST_F(FileManagerFileTasksComplexTest, FindAllTypesOfTasks_GoogleDocument) { std::vector file_urls; path_mime_set.insert( std::make_pair( - drive::util::GetDriveMountPointPath().AppendASCII("foo.gdoc"), + drive::util::GetDriveMountPointPath(&test_profile_).AppendASCII( + "foo.gdoc"), "application/vnd.google-apps.document")); file_urls.push_back(GURL("filesystem:chrome-extension://id/dir/foo.gdoc"));