| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 scoped_refptr<const Extension> LoadExtensionFromDirName( | 42 scoped_refptr<const Extension> LoadExtensionFromDirName( |
| 43 const std::string& extension_dir_name) { | 43 const std::string& extension_dir_name) { |
| 44 FilePath extension_path; | 44 FilePath extension_path; |
| 45 std::string load_error; | 45 std::string load_error; |
| 46 PathService::Get(chrome::DIR_TEST_DATA, &extension_path); | 46 PathService::Get(chrome::DIR_TEST_DATA, &extension_path); |
| 47 extension_path = extension_path.AppendASCII("requirements_checker") | 47 extension_path = extension_path.AppendASCII("requirements_checker") |
| 48 .AppendASCII(extension_dir_name); | 48 .AppendASCII(extension_dir_name); |
| 49 scoped_refptr<const Extension> extension = | 49 scoped_refptr<const Extension> extension = |
| 50 extension_file_util::LoadExtension(extension_path, Extension::LOAD, | 50 extension_file_util::LoadExtension(extension_path, Manifest::LOAD, |
| 51 0, &load_error); | 51 0, &load_error); |
| 52 CHECK(load_error.length() == 0u); | 52 CHECK(load_error.length() == 0u); |
| 53 return extension; | 53 return extension; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ValidateRequirementErrors(std::vector<std::string> expected_errors, | 56 void ValidateRequirementErrors(std::vector<std::string> expected_errors, |
| 57 std::vector<std::string> actual_errors) { | 57 std::vector<std::string> actual_errors) { |
| 58 ASSERT_EQ(expected_errors, actual_errors); | 58 ASSERT_EQ(expected_errors, actual_errors); |
| 59 requirement_errors_.swap(actual_errors); | 59 requirement_errors_.swap(actual_errors); |
| 60 } | 60 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 LoadExtensionFromDirName("require_3d")); | 184 LoadExtensionFromDirName("require_3d")); |
| 185 ASSERT_TRUE(extension.get()); | 185 ASSERT_TRUE(extension.get()); |
| 186 | 186 |
| 187 checker_.Check(extension, base::Bind( | 187 checker_.Check(extension, base::Bind( |
| 188 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, | 188 &RequirementsCheckerBrowserTest::ValidateRequirementErrors, |
| 189 base::Unretained(this), std::vector<std::string>())); | 189 base::Unretained(this), std::vector<std::string>())); |
| 190 content::BrowserThread::GetBlockingPool()->FlushForTesting(); | 190 content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // extensions | 193 } // extensions |
| OLD | NEW |