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

Unified Diff: third_party/WebKit/Source/platform/exported/Platform.cpp

Issue 1780083002: Introduce Platform::setCurrentPlatformForTesting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/exported/Platform.cpp
diff --git a/third_party/WebKit/Source/platform/exported/Platform.cpp b/third_party/WebKit/Source/platform/exported/Platform.cpp
index 72904f70552b179fefbf22415ce953f662f5ff87..82b5fe76c85c63bf2911f3a1ed1db2e5aecfee94 100644
--- a/third_party/WebKit/Source/platform/exported/Platform.cpp
+++ b/third_party/WebKit/Source/platform/exported/Platform.cpp
@@ -82,6 +82,13 @@ void Platform::shutdown()
s_platform = 0;
}
+void Platform::setCurrentPlatformForTesting(Platform* platform)
+{
+ s_platform = platform;
+ if (s_platform)
+ s_platform->m_mainThread = platform->currentThread();
+}
+
Platform* Platform::current()
{
return s_platform;

Powered by Google App Engine
This is Rietveld 408576698