| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "public/platform/WebTaskRunner.h" | 39 #include "public/platform/WebTaskRunner.h" |
| 40 #include "public/platform/WebThread.h" | 40 #include "public/platform/WebThread.h" |
| 41 #include "public/platform/WebTraceLocation.h" | 41 #include "public/platform/WebTraceLocation.h" |
| 42 #include "wtf/text/StringUTF8Adaptor.h" | 42 #include "wtf/text/StringUTF8Adaptor.h" |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 namespace testing { | 45 namespace testing { |
| 46 | 46 |
| 47 void runPendingTasks() | 47 void runPendingTasks() |
| 48 { | 48 { |
| 49 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO
M_HERE, bind(&exitRunLoop)); | 49 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO
M_HERE, WTF::bind(&exitRunLoop)); |
| 50 | 50 |
| 51 // We forbid GC in the tasks. Otherwise the registered GCTaskObserver tries | 51 // We forbid GC in the tasks. Otherwise the registered GCTaskObserver tries |
| 52 // to run GC with NoHeapPointerOnStack. | 52 // to run GC with NoHeapPointerOnStack. |
| 53 ThreadState::current()->enterGCForbiddenScope(); | 53 ThreadState::current()->enterGCForbiddenScope(); |
| 54 enterRunLoop(); | 54 enterRunLoop(); |
| 55 ThreadState::current()->leaveGCForbiddenScope(); | 55 ThreadState::current()->leaveGCForbiddenScope(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void runDelayedTasks(double delayMs) | 58 void runDelayedTasks(double delayMs) |
| 59 { | 59 { |
| 60 Platform::current()->currentThread()->getWebTaskRunner()->postDelayedTask(BL
INK_FROM_HERE, bind(&exitRunLoop), delayMs); | 60 Platform::current()->currentThread()->getWebTaskRunner()->postDelayedTask(BL
INK_FROM_HERE, WTF::bind(&exitRunLoop), delayMs); |
| 61 enterRunLoop(); | 61 enterRunLoop(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 String blinkRootDir() | 64 String blinkRootDir() |
| 65 { | 65 { |
| 66 base::FilePath path; | 66 base::FilePath path; |
| 67 base::PathService::Get(base::DIR_SOURCE_ROOT, &path); | 67 base::PathService::Get(base::DIR_SOURCE_ROOT, &path); |
| 68 path = path.Append(FILE_PATH_LITERAL("third_party/WebKit")); | 68 path = path.Append(FILE_PATH_LITERAL("third_party/WebKit")); |
| 69 path = base::MakeAbsoluteFilePath(path); | 69 path = base::MakeAbsoluteFilePath(path); |
| 70 return String::fromUTF8(path.MaybeAsASCII().c_str()); | 70 return String::fromUTF8(path.MaybeAsASCII().c_str()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 88 base::MessageLoop::current()->QuitWhenIdle(); | 88 base::MessageLoop::current()->QuitWhenIdle(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void yieldCurrentThread() | 91 void yieldCurrentThread() |
| 92 { | 92 { |
| 93 base::PlatformThread::YieldCurrentThread(); | 93 base::PlatformThread::YieldCurrentThread(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace testing | 96 } // namespace testing |
| 97 } // namespace blink | 97 } // namespace blink |
| OLD | NEW |