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

Unified Diff: content/test/layouttest_support.cc

Issue 298263002: Battery Status API: add testing support for LayoutTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some style fixes Created 6 years, 7 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
Index: content/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index 648771015c3e8b2161aa254c2b3ada38870f995b..31d4791abca4a38198456fe2ad439047af6bf93d 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -19,6 +19,7 @@
#include "content/shell/renderer/test_runner/web_frame_test_proxy.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "content/test/test_media_stream_client.h"
+#include "third_party/WebKit/public/platform/WebBatteryStatus.h"
#include "third_party/WebKit/public/platform/WebDeviceMotionData.h"
#include "third_party/WebKit/public/platform/WebDeviceOrientationData.h"
#include "third_party/WebKit/public/platform/WebGamepads.h"
@@ -28,6 +29,7 @@
#include "content/browser/renderer_host/popup_menu_helper_mac.h"
#endif
+using blink::WebBatteryStatus;
using blink::WebDeviceMotionData;
using blink::WebDeviceOrientationData;
using blink::WebGamepad;
@@ -117,6 +119,10 @@ void ResetMockScreenOrientation()
RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting();
}
+void MockBatteryStatusChanged(const WebBatteryStatus& status) {
+ RendererWebKitPlatformSupportImpl::MockBatteryStatusChanged(status);
jochen (gone - plz use gerrit) 2014/05/28 12:08:17 should the battery status be reset between tests?
timvolodine 2014/05/29 08:52:06 good point, I've added a ResetBatteryStatus method
+}
+
void EnableRendererLayoutTestMode() {
RenderThreadImpl::current()->set_layout_test_mode(true);
}

Powered by Google App Engine
This is Rietveld 408576698