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

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerTest.cpp

Issue 2765013003: Add iterator for DocumentMarker::MarkerTypes (Closed)
Patch Set: Make requested changes Created 3 years, 9 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/editing/markers/DocumentMarker.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace blink {
10
11 class DocumentMarkerTest : public ::testing::Test {};
12
13 TEST_F(DocumentMarkerTest, MarkerTypesIterator) {
yosin_UTC9 2017/03/22 04:06:26 I would like to have explicit test cases rather th
14 for (unsigned markerTypesIndex = 0;
15 markerTypesIndex < (1 << DocumentMarker::MarkerTypeIndexesCount);
16 ++markerTypesIndex) {
17 DocumentMarker::MarkerTypes markerTypes(markerTypesIndex);
18 Vector<DocumentMarker::MarkerType> typesFromIterator;
19
20 for (DocumentMarker::MarkerType type : markerTypes)
21 typesFromIterator.push_back(type);
22
23 for (int markerTypeIndex = 0;
24 markerTypeIndex < DocumentMarker::MarkerTypeIndexesCount;
25 ++markerTypeIndex) {
26 DocumentMarker::MarkerType type =
27 static_cast<DocumentMarker::MarkerType>(1 << markerTypeIndex);
28 ASSERT_EQ(markerTypes.contains(type), typesFromIterator.contains(type))
29 << "MarkerTypeIterator returned wrong result for MarkerType "
30 << (1 << markerTypeIndex) << " in MarkerTypes with mask "
31 << markerTypesIndex;
32 }
33 }
34 }
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698