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

Side by Side Diff: content/browser/frame_host/frame_tree_node_blame_context_unittest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (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 "content/browser/frame_host/frame_tree_node_blame_context.h" 5 #include "content/browser/frame_host/frame_tree_node_blame_context.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/trace_event_analyzer.h" 9 #include "base/test/trace_event_analyzer.h"
10 #include "base/trace_event/trace_buffer.h" 10 #include "base/trace_event/trace_buffer.h"
(...skipping 28 matching lines...) Expand all
39 39
40 void ExpectFrameTreeNodeObject(const trace_analyzer::TraceEvent* event) { 40 void ExpectFrameTreeNodeObject(const trace_analyzer::TraceEvent* event) {
41 EXPECT_EQ("navigation", event->category); 41 EXPECT_EQ("navigation", event->category);
42 EXPECT_EQ("FrameTreeNode", event->name); 42 EXPECT_EQ("FrameTreeNode", event->name);
43 } 43 }
44 44
45 void ExpectFrameTreeNodeSnapshot(const trace_analyzer::TraceEvent* event) { 45 void ExpectFrameTreeNodeSnapshot(const trace_analyzer::TraceEvent* event) {
46 ExpectFrameTreeNodeObject(event); 46 ExpectFrameTreeNodeObject(event);
47 EXPECT_TRUE(event->HasArg("snapshot")); 47 EXPECT_TRUE(event->HasArg("snapshot"));
48 EXPECT_TRUE(event->arg_values.at("snapshot") 48 EXPECT_TRUE(event->arg_values.at("snapshot")
49 ->IsType(base::Value::Type::TYPE_DICTIONARY)); 49 ->IsType(base::Value::Type::DICTIONARY));
50 } 50 }
51 51
52 std::string GetParentNodeID(const trace_analyzer::TraceEvent* event) { 52 std::string GetParentNodeID(const trace_analyzer::TraceEvent* event) {
53 const base::Value* arg_snapshot = event->arg_values.at("snapshot").get(); 53 const base::Value* arg_snapshot = event->arg_values.at("snapshot").get();
54 const base::DictionaryValue* snapshot; 54 const base::DictionaryValue* snapshot;
55 EXPECT_TRUE(arg_snapshot->GetAsDictionary(&snapshot)); 55 EXPECT_TRUE(arg_snapshot->GetAsDictionary(&snapshot));
56 if (!snapshot->HasKey("parent")) 56 if (!snapshot->HasKey("parent"))
57 return std::string(); 57 return std::string();
58 const base::DictionaryValue* parent; 58 const base::DictionaryValue* parent;
59 EXPECT_TRUE(snapshot->GetDictionary("parent", &parent)); 59 EXPECT_TRUE(snapshot->GetDictionary("parent", &parent));
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 std::sort(events.begin(), events.end(), EventPointerCompare); 255 std::sort(events.begin(), events.end(), EventPointerCompare);
256 256
257 // Three snapshots are traced, one for each URL change. 257 // Three snapshots are traced, one for each URL change.
258 EXPECT_EQ(3u, events.size()); 258 EXPECT_EQ(3u, events.size());
259 EXPECT_EQ(url1.spec(), GetSnapshotURL(events[0])); 259 EXPECT_EQ(url1.spec(), GetSnapshotURL(events[0]));
260 EXPECT_EQ(url2.spec(), GetSnapshotURL(events[1])); 260 EXPECT_EQ(url2.spec(), GetSnapshotURL(events[1]));
261 EXPECT_EQ("", GetSnapshotURL(events[2])); 261 EXPECT_EQ("", GetSnapshotURL(events[2]));
262 } 262 }
263 263
264 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol_string.cc ('k') | content/browser/service_manager/merge_dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698