| 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/ui/app_list/apps_model_builder.h" | 5 #include "chrome/browser/ui/app_list/apps_model_builder.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/extensions/extension_function_test_utils.h" | 14 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 15 #include "chrome/browser/extensions/extension_service_unittest.h" | 15 #include "chrome/browser/extensions/extension_service_unittest.h" |
| 16 #include "chrome/browser/extensions/extension_sorting.h" | 16 #include "chrome/browser/extensions/extension_sorting.h" |
| 17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
| 18 #include "chrome/common/extensions/manifest.h" | |
| 19 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 20 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "extensions/common/manifest.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "ui/app_list/app_list_item_model.h" | 22 #include "ui/app_list/app_list_item_model.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kHostedAppId[] = "dceacbkfkmllgmjmbhgkpjegnodmildf"; | 26 const char kHostedAppId[] = "dceacbkfkmllgmjmbhgkpjegnodmildf"; |
| 27 const char kPackagedApp1Id[] = "emfkafnhnpcmabnnkckkchdilgeoekbo"; | 27 const char kPackagedApp1Id[] = "emfkafnhnpcmabnnkckkchdilgeoekbo"; |
| 28 const char kPackagedApp2Id[] = "jlklkagmeajbjiobondfhiekepofmljl"; | 28 const char kPackagedApp2Id[] = "jlklkagmeajbjiobondfhiekepofmljl"; |
| 29 | 29 |
| 30 // Get a string of all apps in |model| joined with ','. | 30 // Get a string of all apps in |model| joined with ','. |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 // By default, conflicted items are sorted by their app ids. | 275 // By default, conflicted items are sorted by their app ids. |
| 276 EXPECT_EQ(std::string("Hosted App,Packaged App 1,Packaged App 2"), | 276 EXPECT_EQ(std::string("Hosted App,Packaged App 1,Packaged App 2"), |
| 277 GetModelContent(model.get())); | 277 GetModelContent(model.get())); |
| 278 | 278 |
| 279 // Move hosted app between app1 and app2 and it should not crash. | 279 // Move hosted app between app1 and app2 and it should not crash. |
| 280 service_->OnExtensionMoved(kHostedAppId, kPackagedApp1Id, kPackagedApp2Id); | 280 service_->OnExtensionMoved(kHostedAppId, kPackagedApp1Id, kPackagedApp2Id); |
| 281 EXPECT_EQ(std::string("Packaged App 1,Hosted App,Packaged App 2"), | 281 EXPECT_EQ(std::string("Packaged App 1,Hosted App,Packaged App 2"), |
| 282 GetModelContent(model.get())); | 282 GetModelContent(model.get())); |
| 283 } | 283 } |
| OLD | NEW |