| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const std::vector<std::string>& prereqs, | 56 const std::vector<std::string>& prereqs, |
| 57 ParsingWatcher* watcher) | 57 ParsingWatcher* watcher) |
| 58 : name_(name), prereqs_(prereqs), watcher_(watcher) { | 58 : name_(name), prereqs_(prereqs), watcher_(watcher) { |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual bool Parse(Extension* extension, string16* error) OVERRIDE { | 61 virtual bool Parse(Extension* extension, string16* error) OVERRIDE { |
| 62 watcher_->Record(name_); | 62 watcher_->Record(name_); |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual const std::vector<std::string>& PrerequisiteKeys() OVERRIDE { | 66 virtual const std::vector<std::string>& PrerequisiteKeys() const OVERRIDE { |
| 67 return prereqs_; | 67 return prereqs_; |
| 68 } | 68 } |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 std::string name_; | 71 std::string name_; |
| 72 std::vector<std::string> prereqs_; | 72 std::vector<std::string> prereqs_; |
| 73 ParsingWatcher* watcher_; | 73 ParsingWatcher* watcher_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class FailingTestManifestHandler : public TestManifestHandler { | 76 class FailingTestManifestHandler : public TestManifestHandler { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 class AlwaysParseTestManifestHandler : public TestManifestHandler { | 89 class AlwaysParseTestManifestHandler : public TestManifestHandler { |
| 90 public: | 90 public: |
| 91 AlwaysParseTestManifestHandler(const std::string& name, | 91 AlwaysParseTestManifestHandler(const std::string& name, |
| 92 const std::vector<std::string> prereqs, | 92 const std::vector<std::string> prereqs, |
| 93 ParsingWatcher* watcher) | 93 ParsingWatcher* watcher) |
| 94 : TestManifestHandler(name, prereqs, watcher) { | 94 : TestManifestHandler(name, prereqs, watcher) { |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual bool AlwaysParseForType(Manifest::Type type) OVERRIDE { | 97 virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE { |
| 98 return true; | 98 return true; |
| 99 } | 99 } |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 virtual void TearDown() OVERRIDE { | 103 virtual void TearDown() OVERRIDE { |
| 104 ManifestHandler::ClearRegistryForTesting(); | 104 ManifestHandler::ClearRegistryForTesting(); |
| 105 } | 105 } |
| 106 }; | 106 }; |
| 107 | 107 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 base::FilePath(), | 181 base::FilePath(), |
| 182 Manifest::INVALID_LOCATION, | 182 Manifest::INVALID_LOCATION, |
| 183 *manifest_a, | 183 *manifest_a, |
| 184 Extension::NO_FLAGS, | 184 Extension::NO_FLAGS, |
| 185 &error); | 185 &error); |
| 186 EXPECT_FALSE(extension); | 186 EXPECT_FALSE(extension); |
| 187 EXPECT_EQ("A", error); | 187 EXPECT_EQ("A", error); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace extensions | 190 } // namespace extensions |
| OLD | NEW |