OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/api/developer_private/developer_private_api. h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
597 | 597 |
598 // Load an extension with a clear manifest error ('version' is invalid). | 598 // Load an extension with a clear manifest error ('version' is invalid). |
599 TestExtensionDir dir; | 599 TestExtensionDir dir; |
600 dir.WriteManifest( | 600 dir.WriteManifest( |
601 R"({ | 601 R"({ |
602 "name": "foo", | 602 "name": "foo", |
603 "description": "bar", | 603 "description": "bar", |
604 "version": 1, | 604 "version": 1, |
605 "manifest_version": 2 | 605 "manifest_version": 2 |
606 })"); | 606 })"); |
607 base::FilePath path = dir.UnpackedPath(); | 607 base::FilePath path = base::MakeAbsoluteFilePath(dir.UnpackedPath()); |
Devlin
2017/03/29 15:15:43
Hmm... this doesn't seem like quite the right plac
| |
608 api::EntryPicker::SkipPickerAndAlwaysSelectPathForTest(&path); | 608 api::EntryPicker::SkipPickerAndAlwaysSelectPathForTest(&path); |
609 | 609 |
610 DeveloperPrivateAPI::UnpackedRetryId retry_guid; | 610 DeveloperPrivateAPI::UnpackedRetryId retry_guid; |
611 { | 611 { |
612 // Trying to load the extension should result in a load error with the | 612 // Trying to load the extension should result in a load error with the |
613 // retry id populated. | 613 // retry id populated. |
614 scoped_refptr<UIThreadExtensionFunction> function( | 614 scoped_refptr<UIThreadExtensionFunction> function( |
615 new api::DeveloperPrivateLoadUnpackedFunction()); | 615 new api::DeveloperPrivateLoadUnpackedFunction()); |
616 function->SetRenderFrameHost(web_contents->GetMainFrame()); | 616 function->SetRenderFrameHost(web_contents->GetMainFrame()); |
617 std::unique_ptr<base::Value> result = | 617 std::unique_ptr<base::Value> result = |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
881 EXPECT_TRUE( | 881 EXPECT_TRUE( |
882 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); | 882 profile()->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)); |
883 | 883 |
884 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; | 884 std::unique_ptr<api::developer_private::ProfileInfo> profile_info; |
885 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); | 885 ASSERT_NO_FATAL_FAILURE(GetProfileConfiguration(&profile_info)); |
886 EXPECT_TRUE(profile_info->in_developer_mode); | 886 EXPECT_TRUE(profile_info->in_developer_mode); |
887 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); | 887 EXPECT_FALSE(profile_info->is_developer_mode_controlled_by_policy); |
888 } | 888 } |
889 | 889 |
890 } // namespace extensions | 890 } // namespace extensions |
OLD | NEW |