Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: Source/core/dom/MainThreadTaskRunnerTest.cpp

Issue 1219063013: Fix virtual/override/final usage in Source/core/dom/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/LiveNodeList.h ('k') | Source/core/dom/MessagePort.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 29 matching lines...) Expand all
40 namespace blink { 40 namespace blink {
41 41
42 class MarkingBooleanTask final : public ExecutionContextTask { 42 class MarkingBooleanTask final : public ExecutionContextTask {
43 public: 43 public:
44 static PassOwnPtr<MarkingBooleanTask> create(bool* toBeMarked) 44 static PassOwnPtr<MarkingBooleanTask> create(bool* toBeMarked)
45 { 45 {
46 return adoptPtr(new MarkingBooleanTask(toBeMarked)); 46 return adoptPtr(new MarkingBooleanTask(toBeMarked));
47 } 47 }
48 48
49 49
50 virtual ~MarkingBooleanTask() { } 50 ~MarkingBooleanTask() override { }
51 51
52 private: 52 private:
53 MarkingBooleanTask(bool* toBeMarked) : m_toBeMarked(toBeMarked) { } 53 MarkingBooleanTask(bool* toBeMarked) : m_toBeMarked(toBeMarked) { }
54 54
55 virtual void performTask(ExecutionContext* context) override 55 void performTask(ExecutionContext* context) override
56 { 56 {
57 *m_toBeMarked = true; 57 *m_toBeMarked = true;
58 } 58 }
59 59
60 bool* m_toBeMarked; 60 bool* m_toBeMarked;
61 }; 61 };
62 62
63 TEST(MainThreadTaskRunnerTest, PostTask) 63 TEST(MainThreadTaskRunnerTest, PostTask)
64 { 64 {
65 RefPtrWillBeRawPtr<NullExecutionContext> context = adoptRefWillBeNoop(new Nu llExecutionContext()); 65 RefPtrWillBeRawPtr<NullExecutionContext> context = adoptRefWillBeNoop(new Nu llExecutionContext());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 bool isMarked = false; 97 bool isMarked = false;
98 98
99 context->setTasksNeedSuspension(true); 99 context->setTasksNeedSuspension(true);
100 runner->postTask(FROM_HERE, MarkingBooleanTask::create(&isMarked)); 100 runner->postTask(FROM_HERE, MarkingBooleanTask::create(&isMarked));
101 runner.clear(); 101 runner.clear();
102 blink::testing::runPendingTasks(); 102 blink::testing::runPendingTasks();
103 EXPECT_FALSE(isMarked); 103 EXPECT_FALSE(isMarked);
104 } 104 }
105 105
106 } // namespace blink 106 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/LiveNodeList.h ('k') | Source/core/dom/MessagePort.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698