Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ado/jobs/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- name: Desktop.IntegrationTests.Filter
value: >
(FullyQualifiedName!=RNTesterIntegrationTests::AsyncStorage)&
(FullyQualifiedName!=RNTesterIntegrationTests::Blob)&
(FullyQualifiedName!=RNTesterIntegrationTests::IntegrationTestHarness)&
(FullyQualifiedName!=WebSocketResourcePerformanceTest::ProcessThreadsPerResource)&
(FullyQualifiedName!=Microsoft::React::Test::HttpOriginPolicyIntegrationTest)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Implement Blob module (#9352)",
"packageName": "react-native-windows",
"email": "julio@rochsquadron.net",
"dependentChangeType": "patch"
}
1 change: 0 additions & 1 deletion vnext/Desktop.DLL/react-native-win32.x64.def
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ EXPORTS
?makeChakraRuntime@JSI@Microsoft@@YA?AV?$unique_ptr@VRuntime@jsi@facebook@@U?$default_delete@VRuntime@jsi@facebook@@@std@@@std@@$$QEAUChakraRuntimeArgs@12@@Z
?Make@IHttpResource@Networking@React@Microsoft@@SA?AV?$shared_ptr@UIHttpResource@Networking@React@Microsoft@@@std@@XZ
?CreateTimingModule@react@facebook@@YA?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@AEBV?$shared_ptr@VMessageQueueThread@react@facebook@@@4@@Z
??0WebSocketModule@React@Microsoft@@QEAA@XZ
??0NetworkingModule@React@Microsoft@@QEAA@XZ
?MakeJSQueueThread@ReactNative@Microsoft@@YA?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
?Hash128@SpookyHashV2@hash@folly@@SAXPEBX_KPEA_K2@Z
Expand Down
1 change: 0 additions & 1 deletion vnext/Desktop.DLL/react-native-win32.x86.def
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ EXPORTS
?GetRuntimeOptionString@React@Microsoft@@YA?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z
?makeChakraRuntime@JSI@Microsoft@@YG?AV?$unique_ptr@VRuntime@jsi@facebook@@U?$default_delete@VRuntime@jsi@facebook@@@std@@@std@@$$QAUChakraRuntimeArgs@12@@Z
?CreateTimingModule@react@facebook@@YG?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@ABV?$shared_ptr@VMessageQueueThread@react@facebook@@@4@@Z
??0WebSocketModule@React@Microsoft@@QAE@XZ
?Make@IHttpResource@Networking@React@Microsoft@@SG?AV?$shared_ptr@UIHttpResource@Networking@React@Microsoft@@@std@@XZ
??0NetworkingModule@React@Microsoft@@QAE@XZ
?MakeJSQueueThread@ReactNative@Microsoft@@YG?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ
Expand Down
4 changes: 1 addition & 3 deletions vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include <TestRunner.h>

#include <CreateModules.h>
#include <Modules/NetworkingModule.h>
#include <Modules/WebSocketModule.h>
#include <Threading/MessageQueueThreadFactory.h>
#include <cxxreact/Instance.h>
#include "ChakraRuntimeHolder.h"
Expand Down Expand Up @@ -42,6 +39,7 @@ shared_ptr<ITestInstance> TestRunner::GetInstance(
auto nativeQueue = Microsoft::ReactNative::MakeJSQueueThread();
auto jsQueue = Microsoft::ReactNative::MakeJSQueueThread();

// See InstanceImpl::GetDefaultNativeModules at OInstance.cpp
vector<tuple<string, CxxModule::Provider, shared_ptr<MessageQueueThread>>> extraModules{
{"AsyncLocalStorage",
[]() -> unique_ptr<CxxModule> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
resource->SendRequest(
string{http::to_string(clientArgs.Method).data()},
string{server1Args.Url},
0, /*requestId*/
std::move(clientArgs.RequestHeaders),
{ IHttpResource::BodyData::Type::String, "REQUEST_CONTENT" },
{}, /*data*/
"text",
false, /*useIncrementalUpdates*/
1000, /*timeout*/
Expand Down Expand Up @@ -195,8 +196,9 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
resource->SendRequest(
string{http::to_string(clientArgs.Method).data()},
string{serverArgs.Url},
0, /*requestId*/
std::move(clientArgs.RequestHeaders),
{ IHttpResource::BodyData::Type::String, "REQUEST_CONTENT" },
{}, /*data*/
"text",
false, /*useIncrementalUpdates*/
1000, /*timeout*/
Expand Down Expand Up @@ -290,10 +292,12 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
resource->SendRequest(
"TRACE",
url,
0, /*requestId*/
{
{"ValidHeader", "AnyValue"}
},
{} /*bodyData*/,
{}, /*data*/
//{} /*bodyData*/,
"text",
false /*useIncrementalUpdates*/,
1000 /*timeout*/,
Expand Down
25 changes: 15 additions & 10 deletions vnext/Desktop.IntegrationTests/HttpResourceIntegrationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ TEST_CLASS (HttpResourceIntegrationTest) {
resource->SendRequest(
"GET",
std::move(url),
{} /*header*/,
{} /*bodyData*/,
0, /*requestId*/
{}, /*header*/
{}, /*data*/
"text",
false,
1000 /*timeout*/,
Expand Down Expand Up @@ -128,13 +129,14 @@ TEST_CLASS (HttpResourceIntegrationTest) {
resource->SendRequest(
"GET",
std::move(url),
0, /*requestId*/
{
{"Content-Type", "application/json"},
{"Content-Encoding", "ASCII"},
{"name3", "value3"},
{"name4", "value4"},
},
{} /*bodyData*/,
{}, /*data*/
"text",
false,
1000 /*timeout*/,
Expand Down Expand Up @@ -170,7 +172,7 @@ TEST_CLASS (HttpResourceIntegrationTest) {
promise.set_value();
});

resource->SendRequest("GET", "http://nonexistinghost", {}, {}, "text", false, 1000, false, [](int64_t) {});
resource->SendRequest("GET", "http://nonexistinghost", 0, {}, {}, "text", false, 1000, false, [](int64_t) {});

promise.get_future().wait();

Expand Down Expand Up @@ -238,8 +240,9 @@ TEST_CLASS (HttpResourceIntegrationTest) {
resource->SendRequest(
"OPTIONS",
string{url},
{} /*headers*/,
{} /*bodyData*/,
0, /*requestId*/
{}, /*headers*/
{}, /*data*/
"text",
false,
1000 /*timeout*/,
Expand All @@ -248,8 +251,9 @@ TEST_CLASS (HttpResourceIntegrationTest) {
resource->SendRequest(
"GET",
std::move(url),
{} /*headers*/,
{} /*bodyData*/,
0, /*requestId*/
{}, /*headers*/
{}, /*data*/
"text",
false,
1000 /*timeout*/,
Expand Down Expand Up @@ -330,8 +334,9 @@ TEST_CLASS (HttpResourceIntegrationTest) {
resource->SendRequest(
"GET",
std::move(url),
{} /*headers*/,
{} /*bodyData*/,
0, /*requestId*/
{}, /*headers*/
{}, /*data*/
"text",
false, /*useIncrementalUpdates*/
1000 /*timeout*/,
Expand Down
19 changes: 18 additions & 1 deletion vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ TEST_CLASS (RNTesterIntegrationTests) {
TEST_METHOD(WebSocket) {
// Should behave the same as IntegrationTests/websocket_integration_test_server.js
auto server = std::make_shared<WebSocketServer>(5555, false /*useTLS*/);
server->SetMessageFactory([](std::string &&message) -> std::string { return message + "_response"; });
server->SetMessageFactory([](string &&message) -> string { return message + "_response"; });
server->Start();

TestComponent("WebSocketTest");

server->Stop();
}

BEGIN_TEST_METHOD_ATTRIBUTE(AccessibilityManager)
Expand All @@ -216,5 +218,20 @@ TEST_CLASS (RNTesterIntegrationTests) {
Assert::AreEqual(TestStatus::Passed, result.Status, result.Message.c_str());
}

BEGIN_TEST_METHOD_ATTRIBUTE(WebSocketBlob)
TEST_IGNORE()
END_TEST_METHOD_ATTRIBUTE()
TEST_METHOD(WebSocketBlob) {
auto result = m_runner.RunTest("IntegrationTests/WebSocketBlobTest", "WebSocketBlobTest");
Assert::AreEqual(TestStatus::Passed, result.Status, result.Message.c_str());
}

BEGIN_TEST_METHOD_ATTRIBUTE(Blob)
END_TEST_METHOD_ATTRIBUTE()
TEST_METHOD(Blob) {
auto result = m_runner.RunTest("IntegrationTests/BlobTest", "BlobTest");
Assert::AreEqual(TestStatus::Passed, result.Status, result.Message.c_str());
}

#pragma endregion Extended Tests
};
6 changes: 3 additions & 3 deletions vnext/Desktop.UnitTests/WebSocketModuleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TEST_CLASS (WebSocketModuleTest) {
"connect", "close", "send", "sendBinary", "ping"};

TEST_METHOD(CreateModule) {
auto module = make_unique<WebSocketModule>();
auto module = make_unique<WebSocketModule>(nullptr /*inspectableProperties*/);

Assert::IsFalse(module == nullptr);
Assert::AreEqual(string("WebSocketModule"), module->getName());
Expand All @@ -40,7 +40,7 @@ TEST_CLASS (WebSocketModuleTest) {
}

TEST_METHOD(ConnectEmptyUriFails) {
auto module = make_unique<WebSocketModule>();
auto module = make_unique<WebSocketModule>(nullptr /*inspectableProperties*/);

module->getMethods()
.at(WebSocketModule::MethodId::Connect)
Expand Down Expand Up @@ -70,7 +70,7 @@ TEST_CLASS (WebSocketModuleTest) {
};

auto instance = CreateMockInstance(jsef);
auto module = make_unique<WebSocketModule>();
auto module = make_unique<WebSocketModule>(nullptr /*inspectableProperties*/);
module->setInstance(instance);
module->SetResourceFactory([](const string &) {
auto rc = make_shared<MockWebSocketResource>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)README.md" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"resolved": "2.1.2",
"contentHash": "DXTDuBumPC4oo9KKZMt5zgOuLdfUjqcsLRLyqeubaIxfl7ZBfk8wfsKRWYd1m5aCL3ekifW5pwT3rwuB2mDdLw=="
},
"boost": {
"type": "Transitive",
"resolved": "1.76.0",
"contentHash": "p+w3YvNdXL8Cu9Fzrmexssu0tZbWxuf6ywsQqHjDlKFE5ojXHof1HIyMC3zDLfLnh80dIeFcEUAuR2Asg/XHRA=="
},
"Microsoft.Net.Native.Compiler": {
"type": "Transitive",
"resolved": "2.2.7-rel-27913-00",
Expand Down Expand Up @@ -69,10 +74,25 @@
"resolved": "1.0.1",
"contentHash": "rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw=="
},
"Microsoft.UI.Xaml": {
"type": "Transitive",
"resolved": "2.7.0",
"contentHash": "dB4im13tfmMgL/V3Ei+3kD2rUF+/lTxAmR4gjJ45l577eljHfdo/KUrxpq/3I1Vp6e5GCDG1evDaEGuDxypLMg=="
},
"Microsoft.Windows.CppWinRT": {
"type": "Transitive",
"resolved": "2.0.211028.7",
"contentHash": "JBGI0c3WLoU6aYJRy9Qo0MLDQfObEp+d4nrhR95iyzf7+HOgjRunHDp/6eGFREd7xq3OI1mll9ecJrMfzBvlyg=="
},
"Microsoft.Windows.SDK.BuildTools": {
"type": "Transitive",
"resolved": "10.0.22000.194",
"contentHash": "4L0P3zqut466SIqT3VBeLTNUQTxCBDOrTRymRuROCRJKazcK7ibLz9yAO1nKWRt50ttCj39oAa2Iuz9ZTDmLlg=="
},
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
Expand All @@ -82,6 +102,11 @@
"resolved": "9.0.1",
"contentHash": "U82mHQSKaIk+lpSVCbWYKNavmNH1i5xrExDEquU1i6I5pV6UMOqRnJRSlKO3cMPfcpp0RgDY+8jUXHdQ4IfXvw=="
},
"ReactNative.Hermes.Windows": {
"type": "Transitive",
"resolved": "0.11.0-ms.6",
"contentHash": "WAVLsSZBV4p/3hNC3W67su7xu3f/ZMSKxu0ON7g2GaKRbkJmH0Qyif1IlzcJwtvR48kuOdfgPu7Bgtz3AY+gqg=="
},
"runtime.win10-arm.Microsoft.Net.Native.Compiler": {
"type": "Transitive",
"resolved": "2.2.7-rel-27913-00",
Expand Down Expand Up @@ -268,15 +293,45 @@
"System.Runtime": "4.1.0"
}
},
"microsoft.reactnative": {
"common": {
"type": "Project"
},
"fmt": {
"type": "Project"
},
"folly": {
"type": "Project",
"dependencies": {
"boost": "1.76.0",
"fmt": "1.0.0"
}
},
"microsoft.reactnative": {
"type": "Project",
"dependencies": {
"Common": "1.0.0",
"Folly": "1.0.0",
"Microsoft.UI.Xaml": "2.7.0",
"Microsoft.Windows.CppWinRT": "2.0.211028.7",
"Microsoft.Windows.SDK.BuildTools": "10.0.22000.194",
"ReactCommon": "1.0.0",
"ReactNative.Hermes.Windows": "0.11.0-ms.6",
"boost": "1.76.0"
}
},
"microsoft.reactnative.managed": {
"type": "Project",
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9",
"Microsoft.ReactNative": "1.0.0"
}
},
"reactcommon": {
"type": "Project",
"dependencies": {
"Folly": "1.0.0",
"boost": "1.76.0"
}
}
},
"UAP,Version=v10.0.16299/win10-arm": {
Expand Down
Loading