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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/chromedriver/logging.h"
6
7 #include "base/values.h"
8 #include "chrome/test/chromedriver/capabilities.h"
9 #include "chrome/test/chromedriver/chrome/devtools_event_logger.h"
10 #include "chrome/test/chromedriver/chrome/status.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 TEST(Logging, CreatePerformanceLogger) {
14 Capabilities capabilities;
15 capabilities.logging_prefs.reset(new base::DictionaryValue());
16 capabilities.logging_prefs->SetString("profiler", "INFO");
17
18 ScopedVector<DevToolsEventLogger> loggers;
19 Status status = CreateLoggers(capabilities, &loggers);
20 ASSERT_TRUE(status.IsOk());
21 ASSERT_EQ(1u, loggers.size());
22 ASSERT_STREQ("profiler", loggers[0]->GetLogType().c_str());
23 }
24
25 TEST(Logging, InvalidLogType) {
26 Capabilities capabilities;
27 capabilities.logging_prefs.reset(new base::DictionaryValue());
28 capabilities.logging_prefs->SetString("gaga", "INFO");
29
30 ScopedVector<DevToolsEventLogger> loggers;
31 Status status = CreateLoggers(capabilities, &loggers);
32 EXPECT_FALSE(status.IsOk());
33 ASSERT_EQ(0u, loggers.size());
34 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/logging.cc ('k') | chrome/test/chromedriver/server/chromedriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698