Reverted commit D3443980

Summary:
Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android.

DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector.

For reference, [the relevant issue on react-devtools](https://github.com/facebook/react-devtools/issues/229).
Closes https://github.com/facebook/react-native/pull/8095

Reviewed By: javache

Differential Revision: D3443980

Pulled By: bestander

fbshipit-source-id: ce0f7dd62ae0f7dfe6654380821660f8660318a6
This commit is contained in:
Franklyn Tackitt
2016-06-24 13:25:15 -07:00
committed by Facebook Github Bot 6
parent 91134d16c9
commit f7eca44046
9 changed files with 8 additions and 77 deletions

View File

@@ -1,60 +0,0 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.react.testing;
import javax.annotation.Nullable;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.BaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
/**
* Dummy implementation of storage module, used for testing
*/
public final class FakeWebSocketModule extends BaseJavaModule {
private static WritableMap errorMessage;
static {
errorMessage = Arguments.createMap();
errorMessage.putString("message", "Fake Fake Web Socke tModule");
}
@Override
public String getName() {
return "WebSocketModule";
}
@Override
public boolean canOverrideExistingModule() {
return true;
}
@ReactMethod
public void connect(
final String url,
@Nullable final ReadableArray protocols,
@Nullable final ReadableMap headers,
final int id) {
}
@ReactMethod
public void close(int code, String reason, int id) {
}
@ReactMethod
public void send(String message, int id) {
}
@ReactMethod
public void sendBinary(String base64String, int id) {
}
}

View File

@@ -9,7 +9,6 @@
package com.facebook.react.testing;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.annotation.SuppressLint;
@@ -27,8 +26,7 @@ import com.facebook.react.ReactPackage;
@SuppressLint("JavatestsIncorrectFolder")
public class ReactInstanceSpecForTest {
private final List<NativeModule> mNativeModules =
new ArrayList<NativeModule>(Arrays.asList(new FakeWebSocketModule()));
private final List<NativeModule> mNativeModules = new ArrayList<>();
private final List<Class<? extends JavaScriptModule>> mJSModuleSpecs = new ArrayList<>();
private final List<ViewManager> mViewManagers = new ArrayList<>();
private ReactPackage mReactPackage = null;