| 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 11 matching lines...) Expand all Loading... |
| 22 const char file_url_pattern[] = "file:/"; | 22 const char file_url_pattern[] = "file:/"; |
| 23 const char file_test_prefix[] = "(file test):"; | 23 const char file_test_prefix[] = "(file test):"; |
| 24 const char data_url_pattern[] = "data:"; | 24 const char data_url_pattern[] = "data:"; |
| 25 const std::string::size_type data_url_pattern_size = | 25 const std::string::size_type data_url_pattern_size = |
| 26 sizeof(data_url_pattern) - 1; | 26 sizeof(data_url_pattern) - 1; |
| 27 | 27 |
| 28 // This mock is used to initialize blink. | 28 // This mock is used to initialize blink. |
| 29 class MockBlinkPlatform : NON_EXPORTED_BASE(public blink::Platform) { | 29 class MockBlinkPlatform : NON_EXPORTED_BASE(public blink::Platform) { |
| 30 public: | 30 public: |
| 31 MockBlinkPlatform() { | 31 MockBlinkPlatform() { |
| 32 blink::initializeWithoutV8(this); | 32 blink::Platform::initialize(this); |
| 33 } | 33 } |
| 34 ~MockBlinkPlatform() override {} | 34 ~MockBlinkPlatform() override {} |
| 35 | 35 |
| 36 void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*, | 36 void registerMemoryDumpProvider(blink::WebMemoryDumpProvider*, |
| 37 const char* name) override {} | 37 const char* name) override {} |
| 38 void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*) override {} | 38 void unregisterMemoryDumpProvider(blink::WebMemoryDumpProvider*) override {} |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(MockBlinkPlatform); | 41 DISALLOW_COPY_AND_ASSIGN(MockBlinkPlatform); |
| 42 }; | 42 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 59 result.replace(data_url_pattern_size, url.length(), path); | 59 result.replace(data_url_pattern_size, url.length(), path); |
| 60 } | 60 } |
| 61 return result; | 61 return result; |
| 62 } | 62 } |
| 63 | 63 |
| 64 void EnsureBlinkInitialized() { | 64 void EnsureBlinkInitialized() { |
| 65 g_mock_blink_platform.Get(); | 65 g_mock_blink_platform.Get(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace test_runner | 68 } // namespace test_runner |
| OLD | NEW |