| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ |
| 6 #define EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ | 6 #define EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "extensions/browser/content_verify_job.h" | 10 #include "extensions/browser/content_verify_job.h" |
| 11 | 11 |
| 12 namespace extensions { | 12 namespace extensions { |
| 13 | 13 |
| 14 // A class for use in tests to make content verification failures be ignored | 14 // A class for use in tests to make content verification failures be ignored |
| 15 // during the lifetime of an instance of it. Note that only one instance should | 15 // during the lifetime of an instance of it. Note that only one instance should |
| 16 // be alive at any given time, and that it is not compatible with other | 16 // be alive at any given time, and that it is not compatible with other |
| 17 // concurrent objects using the ContentVerifyJob::TestDelegate interface. | 17 // concurrent objects using the ContentVerifyJob::TestDelegate interface. |
| 18 class ScopedIgnoreContentVerifierForTest | 18 class ScopedIgnoreContentVerifierForTest |
| 19 : public ContentVerifyJob::TestDelegate { | 19 : public ContentVerifyJob::TestDelegate { |
| 20 public: | 20 public: |
| 21 ScopedIgnoreContentVerifierForTest(); | 21 ScopedIgnoreContentVerifierForTest(); |
| 22 ~ScopedIgnoreContentVerifierForTest(); | 22 ~ScopedIgnoreContentVerifierForTest() override; |
| 23 | 23 |
| 24 // ContentVerifyJob::TestDelegate interface | 24 // ContentVerifyJob::TestDelegate interface |
| 25 ContentVerifyJob::FailureReason BytesRead(const std::string& extension_id, | 25 ContentVerifyJob::FailureReason BytesRead(const std::string& extension_id, |
| 26 int count, | 26 int count, |
| 27 const char* data) override; | 27 const char* data) override; |
| 28 ContentVerifyJob::FailureReason DoneReading( | 28 ContentVerifyJob::FailureReason DoneReading( |
| 29 const std::string& extension_id) override; | 29 const std::string& extension_id) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(ScopedIgnoreContentVerifierForTest); | 32 DISALLOW_COPY_AND_ASSIGN(ScopedIgnoreContentVerifierForTest); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 } // namespace extensions | 35 } // namespace extensions |
| 36 | 36 |
| 37 #endif // EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ | 37 #endif // EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ |
| OLD | NEW |