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

Side by Side Diff: ppapi/tests/test_console.cc

Issue 11416214: PPAPI: Move PPB_Console out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_console.h ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "ppapi/tests/test_console.h"
6
7 #include "ppapi/cpp/module.h"
8 #include "ppapi/tests/testing_instance.h"
9
10 REGISTER_TEST_CASE(Console);
11
12 TestConsole::TestConsole(TestingInstance* instance)
13 : TestCase(instance),
14 console_interface_(NULL) {
15 }
16
17 bool TestConsole::Init() {
18 console_interface_ = static_cast<const PPB_Console*>(
19 pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_INTERFACE));
20 return !!console_interface_;
21 }
22
23 void TestConsole::RunTests(const std::string& filter) {
24 RUN_TEST(Smoke, filter);
25 }
26
27 std::string TestConsole::TestSmoke() {
28 // This test does not verify the log message actually reaches the console, but
29 // it does test that the interface exists and that it can be called without
30 // crashing.
31 pp::Var source(std::string("somewhere"));
32 pp::Var message(std::string("hello, world."));
33 console_interface_->Log(instance()->pp_instance(), PP_LOGLEVEL_ERROR,
34 message.pp_var());
35 console_interface_->LogWithSource(instance()->pp_instance(), PP_LOGLEVEL_LOG,
36 source.pp_var(), message.pp_var());
37 PASS();
38 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_console.h ('k') | ppapi/thunk/interfaces_ppb_public_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698