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

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

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase Created 4 years 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 // 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 "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/StyleEngine.h" 8 #include "core/dom/StyleEngine.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/html/HTMLElement.h" 10 #include "core/html/HTMLElement.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 document().body()->setInnerHTML( 46 document().body()->setInnerHTML(
47 "<div>" 47 "<div>"
48 " <span id='x' class='a'></span>" 48 " <span id='x' class='a'></span>"
49 " <span id='y' class='b'><span></span></span>" 49 " <span id='y' class='b'><span></span></span>"
50 " <span id='z'><span></span></span>" 50 " <span id='z'><span></span></span>"
51 "</div>"); 51 "</div>");
52 52
53 CSSSelectorWatch& watch = CSSSelectorWatch::from(document()); 53 CSSSelectorWatch& watch = CSSSelectorWatch::from(document());
54 54
55 Vector<String> selectors; 55 Vector<String> selectors;
56 selectors.append(".a"); 56 selectors.push_back(".a");
57 watch.watchCSSSelectors(selectors); 57 watch.watchCSSSelectors(selectors);
58 58
59 document().view()->updateAllLifecyclePhases(); 59 document().view()->updateAllLifecyclePhases();
60 60
61 selectors.clear(); 61 selectors.clear();
62 selectors.append(".b"); 62 selectors.push_back(".b");
63 selectors.append(".c"); 63 selectors.push_back(".c");
64 selectors.append("#nomatch"); 64 selectors.push_back("#nomatch");
65 watch.watchCSSSelectors(selectors); 65 watch.watchCSSSelectors(selectors);
66 66
67 document().view()->updateAllLifecyclePhases(); 67 document().view()->updateAllLifecyclePhases();
68 68
69 Element* x = document().getElementById("x"); 69 Element* x = document().getElementById("x");
70 Element* y = document().getElementById("y"); 70 Element* y = document().getElementById("y");
71 Element* z = document().getElementById("z"); 71 Element* z = document().getElementById("z");
72 ASSERT_TRUE(x); 72 ASSERT_TRUE(x);
73 ASSERT_TRUE(y); 73 ASSERT_TRUE(y);
74 ASSERT_TRUE(z); 74 ASSERT_TRUE(z);
(...skipping 11 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp ('k') | third_party/WebKit/Source/core/dom/ChildFrameDisconnector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698