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

Side by Side Diff: chrome/browser/chromeos/drive/drive_app_registry_unittest.cc

Issue 18308004: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/drive/drive_app_registry.h" 5 #include "chrome/browser/chromeos/drive/drive_app_registry.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/drive/job_scheduler.h" 10 #include "chrome/browser/chromeos/drive/job_scheduler.h"
11 #include "chrome/browser/drive/fake_drive_service.h" 11 #include "chrome/browser/drive/fake_drive_service.h"
12 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
13 #include "content/public/test/test_browser_thread_bundle.h" 13 #include "content/public/test/test_browser_thread_bundle.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace drive { 16 namespace drive {
17 17
18 class DriveAppRegistryTest : public testing::Test { 18 class DriveAppRegistryTest : public testing::Test {
19 protected: 19 protected:
20 virtual void SetUp() OVERRIDE { 20 virtual void SetUp() OVERRIDE {
21 profile_.reset(new TestingProfile); 21 profile_.reset(new TestingProfile);
22 22
23 fake_drive_service_.reset(new FakeDriveService); 23 fake_drive_service_.reset(new FakeDriveService);
24 fake_drive_service_->LoadAppListForDriveApi("drive/applist.json"); 24 fake_drive_service_->LoadAppListForDriveApi("drive/applist.json");
25 25
26 scheduler_.reset(new JobScheduler(profile_.get(), fake_drive_service_.get(), 26 scheduler_.reset(new JobScheduler(profile_.get(),
27 base::MessageLoopProxy::current())); 27 fake_drive_service_.get(),
28 base::MessageLoopProxy::current().get()));
28 29
29 web_apps_registry_.reset(new DriveAppRegistry(scheduler_.get())); 30 web_apps_registry_.reset(new DriveAppRegistry(scheduler_.get()));
30 web_apps_registry_->Update(); 31 web_apps_registry_->Update();
31 base::RunLoop().RunUntilIdle(); 32 base::RunLoop().RunUntilIdle();
32 } 33 }
33 34
34 bool VerifyApp(const ScopedVector<DriveAppInfo>& list, 35 bool VerifyApp(const ScopedVector<DriveAppInfo>& list,
35 const std::string& web_store_id, 36 const std::string& web_store_id,
36 const std::string& app_id, 37 const std::string& app_id,
37 const std::string& app_name, 38 const std::string& app_name,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // Find by secondary MIME type. 83 // Find by secondary MIME type.
83 ScopedVector<DriveAppInfo> secondary_app; 84 ScopedVector<DriveAppInfo> secondary_app;
84 web_apps_registry_->GetAppsForFile( 85 web_apps_registry_->GetAppsForFile(
85 base::FilePath(), "text/html", &secondary_app); 86 base::FilePath(), "text/html", &secondary_app);
86 ASSERT_EQ(1U, secondary_app.size()); 87 ASSERT_EQ(1U, secondary_app.size());
87 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192", 88 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192",
88 "Drive app 1", "", false); 89 "Drive app 1", "", false);
89 } 90 }
90 91
91 } // namespace drive 92 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698