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

Unified Diff: webkit/plugins/ppapi/time_conversion_unittest.cc

Issue 7344009: Move the time conversion code to the PPAPI shared_impl directory and use it in (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/time_conversion.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/time_conversion_unittest.cc
===================================================================
--- webkit/plugins/ppapi/time_conversion_unittest.cc (revision 92172)
+++ webkit/plugins/ppapi/time_conversion_unittest.cc (working copy)
@@ -6,11 +6,8 @@
#include <stdlib.h>
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/plugins/ppapi/time_conversion.h"
+#include "ppapi/shared_impl/ppapi/time_conversion.h"
-namespace webkit {
-namespace ppapi {
-
// Slop we'll allow in two Time "internal values" to consider them equal.
// Double conversion can introduce rounding errors. The internal values are in
// microseconds, so an error here is very small.
@@ -30,29 +27,28 @@
TEST(TimeConversion, MAYBE_Time) {
// Should be able to round-trip.
base::Time now = base::Time::Now();
- base::Time converted = PPTimeToTime(TimeToPPTime(now));
+ base::Time converted = ppapi::PPTimeToTime(TimeToPPTime(now));
EXPECT_GE(kTimeInternalValueSlop,
abs(static_cast<int>((converted - now).ToInternalValue())));
// Units should be in seconds.
base::Time one_second_from_now = now + base::TimeDelta::FromSeconds(1);
- EXPECT_EQ(1.0, TimeToPPTime(one_second_from_now) - TimeToPPTime(now));
+ EXPECT_EQ(1.0, ppapi::TimeToPPTime(one_second_from_now) -
+ ppapi::TimeToPPTime(now));
}
TEST(TimeConversion, EventTime) {
// Should be able to round-trip.
base::Time now = base::Time::Now();
double event_now = now.ToDoubleT();
- double converted = EventTimeToPPTimeTicks(PPTimeTicksToEventTime(event_now));
+ double converted =
+ ppapi::EventTimeToPPTimeTicks(ppapi::PPTimeTicksToEventTime(event_now));
EXPECT_GE(kTimeSecondsSlop, fabs(converted - event_now));
// Units should be in seconds.
base::Time one_second_from_now = now + base::TimeDelta::FromSeconds(1);
double event_one_second_from_now = one_second_from_now.ToDoubleT();
EXPECT_GE(kTimeSecondsSlop,
- 1.0 - EventTimeToPPTimeTicks(event_one_second_from_now) -
- EventTimeToPPTimeTicks(event_now));
+ 1.0 - ppapi::EventTimeToPPTimeTicks(event_one_second_from_now) -
+ ppapi::EventTimeToPPTimeTicks(event_now));
}
-
-} // namespace ppapi
-} // namespace webkit
« no previous file with comments | « webkit/plugins/ppapi/time_conversion.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698