OLD | NEW |
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_webapps_registry.h" | 5 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 bool VerifyApp2(const ScopedVector<DriveWebAppInfo>& list, | 64 bool VerifyApp2(const ScopedVector<DriveWebAppInfo>& list, |
65 bool is_primary) { | 65 bool is_primary) { |
66 return VerifyApp(list, "deadbeefdeadbeef", "22222222", | 66 return VerifyApp(list, "deadbeefdeadbeef", "22222222", |
67 "Drive App 2", "Drive App Object 2", | 67 "Drive App 2", "Drive App Object 2", |
68 is_primary); | 68 is_primary); |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
72 MessageLoopForUI message_loop_; | 72 base::MessageLoopForUI message_loop_; |
73 content::TestBrowserThread ui_thread_; | 73 content::TestBrowserThread ui_thread_; |
74 }; | 74 }; |
75 | 75 |
76 TEST_F(DriveWebAppsRegistryTest, LoadAndFindWebApps) { | 76 TEST_F(DriveWebAppsRegistryTest, LoadAndFindWebApps) { |
77 scoped_ptr<Value> document = | 77 scoped_ptr<Value> document = |
78 google_apis::test_util::LoadJSONFile( | 78 google_apis::test_util::LoadJSONFile( |
79 "chromeos/gdata/account_metadata.json"); | 79 "chromeos/gdata/account_metadata.json"); |
80 ASSERT_TRUE(document.get()); | 80 ASSERT_TRUE(document.get()); |
81 ASSERT_TRUE(document->GetType() == Value::TYPE_DICTIONARY); | 81 ASSERT_TRUE(document->GetType() == Value::TYPE_DICTIONARY); |
82 DictionaryValue* entry_value; | 82 DictionaryValue* entry_value; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Find by secondary MIME type. | 155 // Find by secondary MIME type. |
156 ScopedVector<DriveWebAppInfo> secondary_app; | 156 ScopedVector<DriveWebAppInfo> secondary_app; |
157 web_apps->GetWebAppsForFile(base::FilePath(), "text/html", &secondary_app); | 157 web_apps->GetWebAppsForFile(base::FilePath(), "text/html", &secondary_app); |
158 ASSERT_EQ(1U, secondary_app.size()); | 158 ASSERT_EQ(1U, secondary_app.size()); |
159 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192", | 159 VerifyApp(secondary_app, "abcdefghabcdefghabcdefghabcdefgh", "123456788192", |
160 "Drive app 1", "", false); | 160 "Drive app 1", "", false); |
161 } | 161 } |
162 | 162 |
163 } // namespace drive | 163 } // namespace drive |
OLD | NEW |