OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/numerics/safe_conversions.h" | 6 #include "base/numerics/safe_conversions.h" |
7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
8 #include "components/keyed_service/core/dependency_graph.h" | 8 #include "components/keyed_service/core/dependency_graph.h" |
9 #include "components/keyed_service/core/dependency_node.h" | 9 #include "components/keyed_service/core/dependency_node.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/re2/re2/re2.h" | 11 #include "third_party/re2/src/re2/re2.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class DependencyGraphTest : public testing::Test {}; | 15 class DependencyGraphTest : public testing::Test {}; |
16 | 16 |
17 class DummyNode : public DependencyNode { | 17 class DummyNode : public DependencyNode { |
18 public: | 18 public: |
19 explicit DummyNode(DependencyGraph* graph) : dependency_graph_(graph) { | 19 explicit DummyNode(DependencyGraph* graph) : dependency_graph_(graph) { |
20 dependency_graph_->AddNode(this); | 20 dependency_graph_->AddNode(this); |
21 } | 21 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 for (const char* name : names) { | 207 for (const char* name : names) { |
208 SCOPED_TRACE(testing::Message("name=") << name); | 208 SCOPED_TRACE(testing::Message("name=") << name); |
209 std::string graph_str = | 209 std::string graph_str = |
210 graph.DumpAsGraphviz("Test", base::Bind(&NodeNameProvider, name)); | 210 graph.DumpAsGraphviz("Test", base::Bind(&NodeNameProvider, name)); |
211 base::StringPiece dumped_name(LocateNodeNameInGraph(graph_str)); | 211 base::StringPiece dumped_name(LocateNodeNameInGraph(graph_str)); |
212 EXPECT_TRUE(IsValidDotId(dumped_name)) << "dumped_name=" << dumped_name; | 212 EXPECT_TRUE(IsValidDotId(dumped_name)) << "dumped_name=" << dumped_name; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 } // namespace | 216 } // namespace |
OLD | NEW |