extensions: disallow empty and whitespace-only shortcut titles.
[chromium-blink-merge.git] / ppapi / tests / test_core.cc
blobd0e2ea088c1d96385460db0aada7fdb67526e052
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
3 // found in the LICENSE file.
5 #include "ppapi/tests/test_core.h"
7 #include "ppapi/cpp/core.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/tests/test_utils.h"
10 #include "ppapi/tests/testing_instance.h"
12 REGISTER_TEST_CASE(Core);
14 bool TestCore::Init() {
15 return true;
18 void TestCore::RunTests(const std::string& filter) {
19 RUN_TEST(Time, filter);
20 RUN_TEST(TimeTicks, filter);
23 std::string TestCore::TestTime() {
24 pp::Core* core = pp::Module::Get()->core();
25 PP_Time time1 = core->GetTime();
26 ASSERT_TRUE(time1 > 0);
28 PlatformSleep(100); // 0.1 second
30 PP_Time time2 = core->GetTime();
31 ASSERT_TRUE(time2 > time1);
33 PASS();
36 std::string TestCore::TestTimeTicks() {
37 pp::Core* core = pp::Module::Get()->core();
38 PP_Time time1 = core->GetTimeTicks();
39 ASSERT_TRUE(time1 > 0);
41 PlatformSleep(100); // 0.1 second
43 PP_Time time2 = core->GetTimeTicks();
44 ASSERT_TRUE(time2 > time1);
46 PASS();