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

Side by Side Diff: third_party/WebKit/Source/core/dom/ActiveDOMObjectTest.cpp

Issue 2366253002: Remove ActiveDOMObject::stop() (Closed)
Patch Set: temp Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 USING_GARBAGE_COLLECTED_MIXIN(MockActiveDOMObject); 44 USING_GARBAGE_COLLECTED_MIXIN(MockActiveDOMObject);
45 45
46 public: 46 public:
47 explicit MockActiveDOMObject(ExecutionContext* context) 47 explicit MockActiveDOMObject(ExecutionContext* context)
48 : ActiveDOMObject(context) {} 48 : ActiveDOMObject(context) {}
49 49
50 DEFINE_INLINE_VIRTUAL_TRACE() { ActiveDOMObject::trace(visitor); } 50 DEFINE_INLINE_VIRTUAL_TRACE() { ActiveDOMObject::trace(visitor); }
51 51
52 MOCK_METHOD0(suspend, void()); 52 MOCK_METHOD0(suspend, void());
53 MOCK_METHOD0(resume, void()); 53 MOCK_METHOD0(resume, void());
54 MOCK_METHOD0(stop, void()); 54 MOCK_METHOD0(contextDestroyed, void());
55 }; 55 };
56 56
57 class ActiveDOMObjectTest : public ::testing::Test { 57 class ActiveDOMObjectTest : public ::testing::Test {
58 protected: 58 protected:
59 ActiveDOMObjectTest(); 59 ActiveDOMObjectTest();
60 60
61 Document& srcDocument() const { return m_srcPageHolder->document(); } 61 Document& srcDocument() const { return m_srcPageHolder->document(); }
62 Document& destDocument() const { return m_destPageHolder->document(); } 62 Document& destDocument() const { return m_destPageHolder->document(); }
63 MockActiveDOMObject& activeDOMObject() { return *m_activeDOMObject; } 63 MockActiveDOMObject& activeDOMObject() { return *m_activeDOMObject; }
64 64
(...skipping 29 matching lines...) Expand all
94 TEST_F(ActiveDOMObjectTest, MoveToSuspendedDocument) { 94 TEST_F(ActiveDOMObjectTest, MoveToSuspendedDocument) {
95 destDocument().suspendScheduledTasks(); 95 destDocument().suspendScheduledTasks();
96 96
97 EXPECT_CALL(activeDOMObject(), suspend()); 97 EXPECT_CALL(activeDOMObject(), suspend());
98 activeDOMObject().didMoveToNewExecutionContext(&destDocument()); 98 activeDOMObject().didMoveToNewExecutionContext(&destDocument());
99 } 99 }
100 100
101 TEST_F(ActiveDOMObjectTest, MoveToStoppedDocument) { 101 TEST_F(ActiveDOMObjectTest, MoveToStoppedDocument) {
102 destDocument().shutdown(); 102 destDocument().shutdown();
103 103
104 EXPECT_CALL(activeDOMObject(), stop()); 104 EXPECT_CALL(activeDOMObject(), contextDestroyed());
105 activeDOMObject().didMoveToNewExecutionContext(&destDocument()); 105 activeDOMObject().didMoveToNewExecutionContext(&destDocument());
106 } 106 }
107 107
108 } // namespace blink 108 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698