OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/dom/CSSSelectorWatch.h" | 5 #include "core/dom/CSSSelectorWatch.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
8 #include "core/dom/StyleEngine.h" | 9 #include "core/dom/StyleEngine.h" |
9 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
10 #include "core/html/HTMLElement.h" | 11 #include "core/html/HTMLElement.h" |
11 #include "core/testing/DummyPageHolder.h" | 12 #include "core/testing/DummyPageHolder.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include <memory> | |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class CSSSelectorWatchTest : public ::testing::Test { | 17 class CSSSelectorWatchTest : public ::testing::Test { |
18 protected: | 18 protected: |
19 void SetUp() override; | 19 void SetUp() override; |
20 | 20 |
21 Document& document() { return m_dummyPageHolder->document(); } | 21 Document& document() { return m_dummyPageHolder->document(); } |
22 StyleEngine& styleEngine() { return document().styleEngine(); } | 22 StyleEngine& styleEngine() { return document().styleEngine(); } |
23 | 23 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 EXPECT_EQ(2u, afterCount - beforeCount); | 86 EXPECT_EQ(2u, afterCount - beforeCount); |
87 | 87 |
88 EXPECT_EQ(1u, addedSelectors(watch).size()); | 88 EXPECT_EQ(1u, addedSelectors(watch).size()); |
89 EXPECT_TRUE(addedSelectors(watch).contains(".c")); | 89 EXPECT_TRUE(addedSelectors(watch).contains(".c")); |
90 | 90 |
91 EXPECT_EQ(1u, removedSelectors(watch).size()); | 91 EXPECT_EQ(1u, removedSelectors(watch).size()); |
92 EXPECT_TRUE(removedSelectors(watch).contains(".b")); | 92 EXPECT_TRUE(removedSelectors(watch).contains(".b")); |
93 } | 93 } |
94 | 94 |
95 } // namespace blink | 95 } // namespace blink |
OLD | NEW |