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/extensions/extension_sorting.h" | 5 #include "chrome/browser/extensions/extension_sorting.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "chrome/browser/extensions/extension_prefs_unittest.h" | 9 #include "chrome/browser/extensions/extension_prefs_unittest.h" |
10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 DictionaryValue simple_dict; | 799 DictionaryValue simple_dict; |
800 simple_dict.SetString(keys::kVersion, "1.0.0.0"); | 800 simple_dict.SetString(keys::kVersion, "1.0.0.0"); |
801 simple_dict.SetString(keys::kName, name); | 801 simple_dict.SetString(keys::kName, name); |
802 simple_dict.SetString(keys::kApp, "true"); | 802 simple_dict.SetString(keys::kApp, "true"); |
803 simple_dict.SetString(keys::kLaunchLocalPath, "fake.html"); | 803 simple_dict.SetString(keys::kLaunchLocalPath, "fake.html"); |
804 | 804 |
805 std::string errors; | 805 std::string errors; |
806 scoped_refptr<Extension> app = Extension::Create( | 806 scoped_refptr<Extension> app = Extension::Create( |
807 prefs_.temp_dir().AppendASCII(name), Extension::EXTERNAL_PREF, | 807 prefs_.temp_dir().AppendASCII(name), Extension::EXTERNAL_PREF, |
808 simple_dict, Extension::NO_FLAGS, &errors); | 808 simple_dict, Extension::NO_FLAGS, &errors); |
809 EXPECT_TRUE(app) << errors; | 809 EXPECT_TRUE(app.get()) << errors; |
810 EXPECT_TRUE(Extension::IdIsValid(app->id())); | 810 EXPECT_TRUE(Extension::IdIsValid(app->id())); |
811 return app; | 811 return app; |
812 } | 812 } |
813 | 813 |
814 void InitDefaultOrdinals() { | 814 void InitDefaultOrdinals() { |
815 default_page_ordinal_ = | 815 default_page_ordinal_ = |
816 syncer::StringOrdinal::CreateInitialOrdinal().CreateAfter(); | 816 syncer::StringOrdinal::CreateInitialOrdinal().CreateAfter(); |
817 default_app_launch_ordinal_ = | 817 default_app_launch_ordinal_ = |
818 syncer::StringOrdinal::CreateInitialOrdinal().CreateBefore(); | 818 syncer::StringOrdinal::CreateInitialOrdinal().CreateBefore(); |
819 } | 819 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 extension_sorting->SetAppLaunchOrdinal(yet_another_app_->id(), | 944 extension_sorting->SetAppLaunchOrdinal(yet_another_app_->id(), |
945 default_app_launch_ordinal_); | 945 default_app_launch_ordinal_); |
946 } | 946 } |
947 | 947 |
948 private: | 948 private: |
949 scoped_refptr<Extension> other_app_; | 949 scoped_refptr<Extension> other_app_; |
950 scoped_refptr<Extension> yet_another_app_; | 950 scoped_refptr<Extension> yet_another_app_; |
951 }; | 951 }; |
952 TEST_F(ExtensionSortingDefaultOrdinalNoCollision, | 952 TEST_F(ExtensionSortingDefaultOrdinalNoCollision, |
953 ExtensionSortingDefaultOrdinalNoCollision) {} | 953 ExtensionSortingDefaultOrdinalNoCollision) {} |
OLD | NEW |