| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/dom/ExecutionContextTask.h" | 31 #include "core/dom/ExecutionContextTask.h" |
| 32 #include "core/testing/NullExecutionContext.h" | 32 #include "core/testing/NullExecutionContext.h" |
| 33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
| 34 #include "platform/testing/UnitTestHelpers.h" | 34 #include "platform/testing/UnitTestHelpers.h" |
| 35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 36 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
| 37 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
| 38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
| 39 | 39 |
| 40 using namespace blink; | 40 namespace blink { |
| 41 | |
| 42 namespace { | |
| 43 | 41 |
| 44 class MarkingBooleanTask final : public ExecutionContextTask { | 42 class MarkingBooleanTask final : public ExecutionContextTask { |
| 45 public: | 43 public: |
| 46 static PassOwnPtr<MarkingBooleanTask> create(bool* toBeMarked) | 44 static PassOwnPtr<MarkingBooleanTask> create(bool* toBeMarked) |
| 47 { | 45 { |
| 48 return adoptPtr(new MarkingBooleanTask(toBeMarked)); | 46 return adoptPtr(new MarkingBooleanTask(toBeMarked)); |
| 49 } | 47 } |
| 50 | 48 |
| 51 | 49 |
| 52 virtual ~MarkingBooleanTask() { } | 50 virtual ~MarkingBooleanTask() { } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 OwnPtr<MainThreadTaskRunner> runner = MainThreadTaskRunner::create(context.g
et()); | 96 OwnPtr<MainThreadTaskRunner> runner = MainThreadTaskRunner::create(context.g
et()); |
| 99 bool isMarked = false; | 97 bool isMarked = false; |
| 100 | 98 |
| 101 context->setTasksNeedSuspension(true); | 99 context->setTasksNeedSuspension(true); |
| 102 runner->postTask(FROM_HERE, MarkingBooleanTask::create(&isMarked)); | 100 runner->postTask(FROM_HERE, MarkingBooleanTask::create(&isMarked)); |
| 103 runner.clear(); | 101 runner.clear(); |
| 104 blink::testing::runPendingTasks(); | 102 blink::testing::runPendingTasks(); |
| 105 EXPECT_FALSE(isMarked); | 103 EXPECT_FALSE(isMarked); |
| 106 } | 104 } |
| 107 | 105 |
| 108 } | 106 } // namespace blink |
| OLD | NEW |