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

Unified Diff: chrome/test/chromedriver/logging_unittest.cc

Issue 14263024: Logging API in chromedriver2. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/logging_unittest.cc
===================================================================
--- chrome/test/chromedriver/logging_unittest.cc (revision 0)
+++ chrome/test/chromedriver/logging_unittest.cc (revision 0)
@@ -0,0 +1,34 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/chromedriver/logging.h"
+
+#include "base/values.h"
+#include "chrome/test/chromedriver/capabilities.h"
+#include "chrome/test/chromedriver/chrome/devtools_event_logger.h"
+#include "chrome/test/chromedriver/chrome/status.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(Logging, CreatePerformanceLogger) {
+ Capabilities capabilities;
+ capabilities.logging_prefs.reset(new base::DictionaryValue());
+ capabilities.logging_prefs->SetString("performance", "INFO");
+
+ ScopedVector<DevToolsEventLogger> loggers;
+ Status status = CreateLoggers(capabilities, &loggers);
+ ASSERT_TRUE(status.IsOk());
+ ASSERT_EQ(1u, loggers.size());
+ ASSERT_STREQ("performance", loggers[0]->GetLogType().c_str());
+}
+
+TEST(Logging, InvalidLogType) {
+ Capabilities capabilities;
+ capabilities.logging_prefs.reset(new base::DictionaryValue());
+ capabilities.logging_prefs->SetString("gaga", "INFO");
+
+ ScopedVector<DevToolsEventLogger> loggers;
+ Status status = CreateLoggers(capabilities, &loggers);
+ EXPECT_FALSE(status.IsOk());
+ ASSERT_EQ(0u, loggers.size());
+}

Powered by Google App Engine
This is Rietveld 408576698