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

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

Issue 9651002: Add C++ wrappers for output parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: With swapping Created 8 years, 9 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 | Annotate | Revision Log
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_flash.h" 5 #include "ppapi/tests/test_flash.h"
6 6
7 #include "ppapi/c/pp_macros.h" 7 #include "ppapi/c/pp_macros.h"
8 #include "ppapi/c/private/ppb_flash.h" 8 #include "ppapi/c/private/ppb_flash.h"
9 #include "ppapi/cpp/instance.h" 9 #include "ppapi/cpp/instance.h"
10 #include "ppapi/cpp/module.h" 10 #include "ppapi/cpp/module.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 flash_interface_->GetProxyForURL(instance_->pp_instance(), 65 flash_interface_->GetProxyForURL(instance_->pp_instance(),
66 "this_isnt_an_url")); 66 "this_isnt_an_url"));
67 // Should be an error. 67 // Should be an error.
68 ASSERT_TRUE(result.is_undefined()); 68 ASSERT_TRUE(result.is_undefined());
69 69
70 PASS(); 70 PASS();
71 } 71 }
72 72
73 std::string TestFlash::TestMessageLoop() { 73 std::string TestFlash::TestMessageLoop() {
74 pp::CompletionCallback callback = 74 pp::CompletionCallback callback =
75 callback_factory_.NewRequiredCallback(&TestFlash::QuitMessageLoopTask); 75 callback_factory_.NewCallback(&TestFlash::QuitMessageLoopTask);
76 pp::Module::Get()->core()->CallOnMainThread(0, callback); 76 pp::Module::Get()->core()->CallOnMainThread(0, callback);
77 flash_interface_->RunMessageLoop(instance_->pp_instance()); 77 flash_interface_->RunMessageLoop(instance_->pp_instance());
78 78
79 PASS(); 79 PASS();
80 } 80 }
81 81
82 std::string TestFlash::TestGetLocalTimeZoneOffset() { 82 std::string TestFlash::TestGetLocalTimeZoneOffset() {
83 double result = flash_interface_->GetLocalTimeZoneOffset( 83 double result = flash_interface_->GetLocalTimeZoneOffset(
84 instance_->pp_instance(), 1321491298.0); 84 instance_->pp_instance(), 1321491298.0);
85 // The result depends on the local time zone, but +/- 14h from UTC should 85 // The result depends on the local time zone, but +/- 14h from UTC should
86 // cover the possibilities. 86 // cover the possibilities.
87 ASSERT_TRUE(result >= -14 * 60 * 60); 87 ASSERT_TRUE(result >= -14 * 60 * 60);
88 ASSERT_TRUE(result <= 14 * 60 * 60); 88 ASSERT_TRUE(result <= 14 * 60 * 60);
89 89
90 PASS(); 90 PASS();
91 } 91 }
92 92
93 std::string TestFlash::TestGetCommandLineArgs() { 93 std::string TestFlash::TestGetCommandLineArgs() {
94 Var result(pp::PASS_REF, 94 Var result(pp::PASS_REF,
95 flash_interface_->GetCommandLineArgs( 95 flash_interface_->GetCommandLineArgs(
96 pp::Module::Get()->pp_module())); 96 pp::Module::Get()->pp_module()));
97 ASSERT_TRUE(result.is_string()); 97 ASSERT_TRUE(result.is_string());
98 98
99 PASS(); 99 PASS();
100 } 100 }
101 101
102 void TestFlash::QuitMessageLoopTask(int32_t) { 102 void TestFlash::QuitMessageLoopTask(int32_t) {
103 flash_interface_->QuitMessageLoop(instance_->pp_instance()); 103 flash_interface_->QuitMessageLoop(instance_->pp_instance());
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698