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

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

Issue 8477015: Make it possible to enable/disable specific ppapi tests. Migrate PostMessage tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix license headers. Created 9 years, 1 month 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_uma.h ('k') | ppapi/tests/test_url_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/tests/test_uma.h" 5 #include "ppapi/tests/test_uma.h"
6 6
7 #include "ppapi/c/private/ppb_uma_private.h" 7 #include "ppapi/c/private/ppb_uma_private.h"
8 #include "ppapi/cpp/instance.h" 8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/module.h" 9 #include "ppapi/cpp/module.h"
10 #include "ppapi/tests/testing_instance.h" 10 #include "ppapi/tests/testing_instance.h"
11 11
12 REGISTER_TEST_CASE(UMA); 12 REGISTER_TEST_CASE(UMA);
13 13
14 bool TestUMA::Init() { 14 bool TestUMA::Init() {
15 uma_interface_ = reinterpret_cast<PPB_UMA_Private const*>( 15 uma_interface_ = reinterpret_cast<PPB_UMA_Private const*>(
16 pp::Module::Get()->GetBrowserInterface(PPB_UMA_PRIVATE_INTERFACE)); 16 pp::Module::Get()->GetBrowserInterface(PPB_UMA_PRIVATE_INTERFACE));
17 return !!uma_interface_; 17 return !!uma_interface_;
18 } 18 }
19 19
20 void TestUMA::RunTest() { 20 void TestUMA::RunTests(const std::string& filter) {
21 instance_->LogTest("Count", TestCount()); 21 instance_->LogTest("Count", TestCount());
22 instance_->LogTest("Time", TestTime()); 22 instance_->LogTest("Time", TestTime());
23 instance_->LogTest("Enum", TestEnum()); 23 instance_->LogTest("Enum", TestEnum());
24 } 24 }
25 25
26 std::string TestUMA::TestCount() { 26 std::string TestUMA::TestCount() {
27 pp::Var name_var = pp::Var("Test.CountHistogram"); 27 pp::Var name_var = pp::Var("Test.CountHistogram");
28 PP_Var name = name_var.pp_var(); 28 PP_Var name = name_var.pp_var();
29 uma_interface_->HistogramCustomCounts(name, 10, 1, 100, 50); 29 uma_interface_->HistogramCustomCounts(name, 10, 1, 100, 50);
30 uma_interface_->HistogramCustomCounts(name, 30, 1, 100, 50); 30 uma_interface_->HistogramCustomCounts(name, 30, 1, 100, 50);
(...skipping 16 matching lines...) Expand all
47 pp::Var name_var = pp::Var("Test.EnumHistogram"); 47 pp::Var name_var = pp::Var("Test.EnumHistogram");
48 PP_Var name = name_var.pp_var(); 48 PP_Var name = name_var.pp_var();
49 uma_interface_->HistogramEnumeration(name, 0, 5); 49 uma_interface_->HistogramEnumeration(name, 0, 5);
50 uma_interface_->HistogramEnumeration(name, 3, 5); 50 uma_interface_->HistogramEnumeration(name, 3, 5);
51 uma_interface_->HistogramEnumeration(name, 3, 5); 51 uma_interface_->HistogramEnumeration(name, 3, 5);
52 uma_interface_->HistogramEnumeration(name, 1, 5); 52 uma_interface_->HistogramEnumeration(name, 1, 5);
53 uma_interface_->HistogramEnumeration(name, 2, 5); 53 uma_interface_->HistogramEnumeration(name, 2, 5);
54 PASS(); 54 PASS();
55 } 55 }
56 56
OLDNEW
« no previous file with comments | « ppapi/tests/test_uma.h ('k') | ppapi/tests/test_url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698