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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElementTest.cpp

Issue 2970833002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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/html/HTMLSlotElement.h" 5 #include "core/html/HTMLSlotElement.h"
6 6
7 #include <array> 7 #include <array>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 namespace { 13 namespace {
14 constexpr int kTableSize = 16; 14 constexpr int kTableSize = 16;
15 using Seq = std::vector<char>; 15 using Seq = std::vector<char>;
16 using Backtrack = std::pair<size_t, size_t>; 16 using Backtrack = std::pair<size_t, size_t>;
17 } 17 }
18 18
19 class HTMLSlotElementTest : public testing::Test { 19 class HTMLSlotElementTest : public ::testing::Test {
20 protected: 20 protected:
21 HTMLSlotElementTest() {} 21 HTMLSlotElementTest() {}
22 Seq LongestCommonSubsequence(const Seq& seq1, const Seq& seq2); 22 Seq LongestCommonSubsequence(const Seq& seq1, const Seq& seq2);
23 std::array<std::array<size_t, kTableSize>, kTableSize> lcs_table_; 23 std::array<std::array<size_t, kTableSize>, kTableSize> lcs_table_;
24 std::array<std::array<Backtrack, kTableSize>, kTableSize> backtrack_table_; 24 std::array<std::array<Backtrack, kTableSize>, kTableSize> backtrack_table_;
25 }; 25 };
26 26
27 std::vector<char> HTMLSlotElementTest::LongestCommonSubsequence( 27 std::vector<char> HTMLSlotElementTest::LongestCommonSubsequence(
28 const Seq& seq1, 28 const Seq& seq1,
29 const Seq& seq2) { 29 const Seq& seq2) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // If we use kTableSize here, it should hit DCHECK(). 122 // If we use kTableSize here, it should hit DCHECK().
123 std::fill_n(std::back_inserter(seq1), kTableSize - 1, 'a'); 123 std::fill_n(std::back_inserter(seq1), kTableSize - 1, 'a');
124 Seq seq2; 124 Seq seq2;
125 std::fill_n(std::back_inserter(seq2), kTableSize - 1, 'a'); 125 std::fill_n(std::back_inserter(seq2), kTableSize - 1, 'a');
126 Seq lcs; 126 Seq lcs;
127 std::fill_n(std::back_inserter(lcs), kTableSize - 1, 'a'); 127 std::fill_n(std::back_inserter(lcs), kTableSize - 1, 'a');
128 EXPECT_EQ(lcs, LongestCommonSubsequence(seq1, seq2)); 128 EXPECT_EQ(lcs, LongestCommonSubsequence(seq1, seq2));
129 } 129 }
130 130
131 } // namespace blink 131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698