OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/test/test_blink_web_unit_test_support.h" | 5 #include "content/test/test_blink_web_unit_test_support.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 return blink::WebData(buffer.data(), buffer.size()); | 354 return blink::WebData(buffer.data(), buffer.size()); |
355 } | 355 } |
356 | 356 |
357 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { | 357 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { |
358 if (web_thread_ && web_thread_->isCurrentThread()) | 358 if (web_thread_ && web_thread_->isCurrentThread()) |
359 return web_thread_.get(); | 359 return web_thread_.get(); |
360 return BlinkPlatformImpl::currentThread(); | 360 return BlinkPlatformImpl::currentThread(); |
361 } | 361 } |
362 | 362 |
363 void TestBlinkWebUnitTestSupport::enterRunLoop() { | |
364 DCHECK(base::MessageLoop::current()); | |
365 DCHECK(!base::MessageLoop::current()->is_running()); | |
366 base::MessageLoop::current()->Run(); | |
367 } | |
368 | |
369 void TestBlinkWebUnitTestSupport::exitRunLoop() { | |
370 base::MessageLoop::current()->QuitWhenIdle(); | |
371 } | |
372 | |
373 void TestBlinkWebUnitTestSupport::getPluginList( | 363 void TestBlinkWebUnitTestSupport::getPluginList( |
374 bool refresh, blink::WebPluginListBuilder* builder) { | 364 bool refresh, blink::WebPluginListBuilder* builder) { |
375 builder->addPlugin("pdf", "pdf", "pdf-files"); | 365 builder->addPlugin("pdf", "pdf", "pdf-files"); |
376 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); | 366 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); |
377 } | 367 } |
378 | 368 |
379 } // namespace content | 369 } // namespace content |
OLD | NEW |