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