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

Unified Diff: Source/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.cpp

Issue 293403002: Introduce mock test system for navigator content utils (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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: Source/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.cpp
diff --git a/Source/modules/vibration/testing/InternalsVibration.cpp b/Source/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.cpp
similarity index 75%
copy from Source/modules/vibration/testing/InternalsVibration.cpp
copy to Source/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.cpp
index 01ce84151d57fe5543288dc65892c6c2f82d9cda..4d0c0d4ad1fb1bb125c21fc80683cdf2e3db32e2 100644
--- a/Source/modules/vibration/testing/InternalsVibration.cpp
+++ b/Source/modules/navigatorcontentutils/testing/InternalsNavigatorContentUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2014 Samsung Electronics. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,24 +29,20 @@
*/
#include "config.h"
-#include "InternalsVibration.h"
+#include "InternalsNavigatorContentUtils.h"
#include "core/dom/Document.h"
#include "core/testing/Internals.h"
-#include "modules/vibration/NavigatorVibration.h"
+#include "modules/navigatorcontentutils/NavigatorContentUtils.h"
+#include "modules/navigatorcontentutils/testing/NavigatorContentUtilsClientMock.h"
namespace WebCore {
-bool InternalsVibration::isVibrating(Internals&, Document* document)
+void InternalsNavigatorContentUtils::setNavigatorContentUtilsClientMock(Internals&, Document* document)
{
ASSERT(document && document->page());
- return NavigatorVibration::from(*document->page()).isVibrating();
-}
-
-Vector<unsigned> InternalsVibration::pendingVibrationPattern(Internals&, Document* document)
-{
- ASSERT(document && document->page());
- return NavigatorVibration::from(*document->page()).pattern();
+ NavigatorContentUtils* navigatorContentUtils = NavigatorContentUtils::from(*document->page());
+ navigatorContentUtils->setClientForTest(adoptPtr(new NavigatorContentUtilsClientMock()));
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698