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

Side by Side Diff: chrome/test/chromedriver/performance_logger_unittest.cc

Issue 2753763005: [chromedriver] Use percentFull instead of value in Tracing.bufferUsage. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/test/chromedriver/performance_logger.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/test/chromedriver/performance_logger.h" 5 #include "chrome/test/chromedriver/performance_logger.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 FakeBrowserwideClient client; 373 FakeBrowserwideClient client;
374 FakeLog log; 374 FakeLog log;
375 Session session("test"); 375 Session session("test");
376 PerfLoggingPrefs prefs; 376 PerfLoggingPrefs prefs;
377 prefs.trace_categories = "benchmark,blink.console"; 377 prefs.trace_categories = "benchmark,blink.console";
378 PerformanceLogger logger(&log, &session, prefs); 378 PerformanceLogger logger(&log, &session, prefs);
379 379
380 client.AddListener(&logger); 380 client.AddListener(&logger);
381 logger.OnConnected(&client); 381 logger.OnConnected(&client);
382 base::DictionaryValue params; 382 base::DictionaryValue params;
383 params.SetDouble("value", 1.0); 383 params.SetDouble("percentFull", 1.0);
384 ASSERT_EQ(kOk, client.TriggerEvent("Tracing.bufferUsage", params).code()); 384 ASSERT_EQ(kOk, client.TriggerEvent("Tracing.bufferUsage", params).code());
385 385
386 ASSERT_EQ(1u, log.GetEntries().size()); 386 ASSERT_EQ(1u, log.GetEntries().size());
387 LogEntry* entry = log.GetEntries()[0]; 387 LogEntry* entry = log.GetEntries()[0];
388 EXPECT_EQ(Log::kWarning, entry->level); 388 EXPECT_EQ(Log::kWarning, entry->level);
389 EXPECT_LT(0, entry->timestamp.ToTimeT()); 389 EXPECT_LT(0, entry->timestamp.ToTimeT());
390 std::unique_ptr<base::DictionaryValue> message( 390 std::unique_ptr<base::DictionaryValue> message(
391 ParseDictionary(entry->message)); 391 ParseDictionary(entry->message));
392 std::string webview; 392 std::string webview;
393 EXPECT_TRUE(message->GetString("webview", &webview)); 393 EXPECT_TRUE(message->GetString("webview", &webview));
394 EXPECT_EQ(DevToolsClientImpl::kBrowserwideDevToolsClientId, webview); 394 EXPECT_EQ(DevToolsClientImpl::kBrowserwideDevToolsClientId, webview);
395 std::string method; 395 std::string method;
396 EXPECT_TRUE(message->GetString("message.method", &method)); 396 EXPECT_TRUE(message->GetString("message.method", &method));
397 EXPECT_EQ("Tracing.bufferUsage", method); 397 EXPECT_EQ("Tracing.bufferUsage", method);
398 base::DictionaryValue* actual_params; 398 base::DictionaryValue* actual_params;
399 EXPECT_TRUE(message->GetDictionary("message.params", &actual_params)); 399 EXPECT_TRUE(message->GetDictionary("message.params", &actual_params));
400 EXPECT_TRUE(actual_params->HasKey("error")); 400 EXPECT_TRUE(actual_params->HasKey("error"));
401 } 401 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/performance_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698