| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/test_common.h" | 5 #include "components/test_runner/test_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 sizeof(data_url_pattern) - 1; | 27 sizeof(data_url_pattern) - 1; |
| 28 | 28 |
| 29 // This mock is used to initialize blink. | 29 // This mock is used to initialize blink. |
| 30 class MockBlinkPlatform : NON_EXPORTED_BASE(public blink::Platform) { | 30 class MockBlinkPlatform : NON_EXPORTED_BASE(public blink::Platform) { |
| 31 public: | 31 public: |
| 32 MockBlinkPlatform() { | 32 MockBlinkPlatform() { |
| 33 blink::Platform::initialize(this); | 33 blink::Platform::initialize(this); |
| 34 } | 34 } |
| 35 ~MockBlinkPlatform() override {} | 35 ~MockBlinkPlatform() override {} |
| 36 | 36 |
| 37 void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*, | |
| 38 const char* name) override {} | |
| 39 void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*) override {} | |
| 40 | |
| 41 private: | 37 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(MockBlinkPlatform); | 38 DISALLOW_COPY_AND_ASSIGN(MockBlinkPlatform); |
| 43 }; | 39 }; |
| 44 | 40 |
| 45 base::LazyInstance<MockBlinkPlatform>::Leaky g_mock_blink_platform = | 41 base::LazyInstance<MockBlinkPlatform>::Leaky g_mock_blink_platform = |
| 46 LAZY_INSTANCE_INITIALIZER; | 42 LAZY_INSTANCE_INITIALIZER; |
| 47 | 43 |
| 48 const char* kIllegalString = "illegal value"; | 44 const char* kIllegalString = "illegal value"; |
| 49 const char* kPolicyIgnore = "Ignore"; | 45 const char* kPolicyIgnore = "Ignore"; |
| 50 const char* kPolicyDownload = "download"; | 46 const char* kPolicyDownload = "download"; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 std::unique_ptr<char[]> chars(new char[length]); | 100 std::unique_ptr<char[]> chars(new char[length]); |
| 105 v8_str->WriteUtf8(chars.get(), length); | 101 v8_str->WriteUtf8(chars.get(), length); |
| 106 return blink::WebString::fromUTF8(chars.get()); | 102 return blink::WebString::fromUTF8(chars.get()); |
| 107 } | 103 } |
| 108 | 104 |
| 109 void EnsureBlinkInitialized() { | 105 void EnsureBlinkInitialized() { |
| 110 g_mock_blink_platform.Get(); | 106 g_mock_blink_platform.Get(); |
| 111 } | 107 } |
| 112 | 108 |
| 113 } // namespace test_runner | 109 } // namespace test_runner |
| OLD | NEW |