diff --git a/.ado/windows-vs-pr.yml b/.ado/windows-vs-pr.yml
index f9543164443..6053ac20843 100644
--- a/.ado/windows-vs-pr.yml
+++ b/.ado/windows-vs-pr.yml
@@ -315,7 +315,7 @@ jobs:
language: cs
configuration: Release
- timeoutInMinutes: 30 # how long to run the job before automatically cancelling
+ timeoutInMinutes: 40 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
pool:
vmImage: $(VmImage)
diff --git a/change/react-native-windows-2019-12-06-09-47-37-e2echange.json b/change/react-native-windows-2019-12-06-09-47-37-e2echange.json
new file mode 100644
index 00000000000..e312e834748
--- /dev/null
+++ b/change/react-native-windows-2019-12-06-09-47-37-e2echange.json
@@ -0,0 +1,8 @@
+{
+ "type": "prerelease",
+ "comment": "Update E2ETest to use ReactApplication",
+ "packageName": "react-native-windows",
+ "email": "dida@ntdev.microsoft.com",
+ "commit": "39286c82c6393e68725d202f121825a00d1865b2",
+ "date": "2019-12-06T17:47:37.097Z"
+}
\ No newline at end of file
diff --git a/packages/E2ETest/windows/ReactUWPTestApp.sln b/packages/E2ETest/windows/ReactUWPTestApp.sln
index 328be270c74..72a6b2edf8a 100644
--- a/packages/E2ETest/windows/ReactUWPTestApp.sln
+++ b/packages/E2ETest/windows/ReactUWPTestApp.sln
@@ -38,11 +38,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Universal", "..\..\..\v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\..\vnext\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\..\..\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.ReactNative.SharedManaged", "..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.shproj", "{67A1076F-7790-4203-86EA-4402CCB5E782}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
..\..\..\vnext\Chakra\Chakra.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
..\..\..\vnext\Shared\Shared.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
+ ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{67a1076f-7790-4203-86ea-4402ccb5e782}*SharedItemsImports = 13
..\..\..\vnext\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4
+ ..\..\..\vnext\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{abbb0407-0e82-486f-94ce-710900fcaadc}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
@@ -143,10 +151,32 @@ Global
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.ActiveCfg = Debug|ARM
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.Build.0 = Debug|ARM
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.ActiveCfg = Release|ARM
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.Build.0 = Release|ARM
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {11C084A3-A57C-4296-A679-CAC17B603144} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {A62D504A-16B8-41D2-9F19-E2E86019E5E4} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ {67A1076F-7790-4203-86EA-4402CCB5E782} = {AB7DB37D-898C-4BBC-9F2A-E043EC90C8F3}
+ EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5EAF3BA-6B6F-4E81-B5C6-49B30EC0A32E}
EndGlobalSection
diff --git a/packages/E2ETest/windows/ReactUWPTestApp/App.xaml b/packages/E2ETest/windows/ReactUWPTestApp/App.xaml
index 2e16904310c..d261251013c 100644
--- a/packages/E2ETest/windows/ReactUWPTestApp/App.xaml
+++ b/packages/E2ETest/windows/ReactUWPTestApp/App.xaml
@@ -1,4 +1,5 @@
-
-
+
diff --git a/packages/E2ETest/windows/ReactUWPTestApp/App.xaml.cs b/packages/E2ETest/windows/ReactUWPTestApp/App.xaml.cs
index 07f738fd624..16d3716cf67 100644
--- a/packages/E2ETest/windows/ReactUWPTestApp/App.xaml.cs
+++ b/packages/E2ETest/windows/ReactUWPTestApp/App.xaml.cs
@@ -7,87 +7,53 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
+using Microsoft.ReactNative;
+using Windows.UI.Core;
namespace ReactUWPTestApp
{
- ///
- /// Provides application-specific behavior to supplement the default Application class.
- ///
- sealed partial class App : Application
- {
///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
+ /// Provides application-specific behavior to supplement the default Application class.
///
- public App()
+ sealed partial class App : ReactApplication
{
- this.InitializeComponent();
- this.Suspending += OnSuspending;
- }
-
- ///
- /// Invoked when the application is launched normally by the end user. Other entry points
- /// will be used such as when the application is launched to open a specific file.
- ///
- /// Details about the launch request and process.
- protected override void OnLaunched(LaunchActivatedEventArgs e)
- {
- Frame rootFrame = Window.Current.Content as Frame;
-
- // Do not repeat app initialization when the Window already has content,
- // just ensure that the window is active
- if (rootFrame == null)
- {
- // Create a Frame to act as the navigation context and navigate to the first page
- rootFrame = new Frame();
-
- rootFrame.NavigationFailed += OnNavigationFailed;
-
- if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
{
- //TODO: Load state from previously suspended application
+ MainComponentName = "ReactUWPTestApp";
+
+#if BUNDLE
+ JavaScriptBundleFile = "index.windows";
+ InstanceSettings.UseWebDebugger = false;
+ InstanceSettings.UseLiveReload = false;
+#else
+ JavaScriptMainModuleName = "app/index";
+ InstanceSettings.UseWebDebugger = true;
+ InstanceSettings.UseLiveReload = true;
+#endif
+
+#if DEBUG
+ InstanceSettings.EnableDeveloperMenu = true;
+#else
+ InstanceSettings.EnableDeveloperMenu = false;
+#endif
+
+ PackageProviders.Add(new Microsoft.ReactNative.Managed.ReactPackageProvider()); // Includes any modules in this project
+ this.InitializeComponent();
}
- // Place the frame in the current Window
- Window.Current.Content = rootFrame;
- }
-
- if (e.PrelaunchActivated == false)
- {
- if (rootFrame.Content == null)
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
{
- // When the navigation stack isn't restored navigate to the first page,
- // configuring the new page by passing required information as a navigation
- // parameter
- rootFrame.Navigate(typeof(ReactTestPage), e.Arguments);
+ base.OnLaunched(e);
+ SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
}
- // Ensure the current window is active
- Window.Current.Activate();
- }
- }
-
- ///
- /// Invoked when Navigation to a certain page fails
- ///
- /// The Frame which failed navigation
- /// Details about the navigation failure
- void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
- {
- throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
- }
-
- ///
- /// Invoked when application execution is being suspended. Application state is saved
- /// without knowing whether the application will be terminated or resumed with the contents
- /// of memory still intact.
- ///
- /// The source of the suspend request.
- /// Details about the suspend request.
- private void OnSuspending(object sender, SuspendingEventArgs e)
- {
- var deferral = e.SuspendingOperation.GetDeferral();
- //TODO: Save application state and stop any background activity
- deferral.Complete();
}
- }
}
diff --git a/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml b/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml
deleted file mode 100644
index b5d565c8a09..00000000000
--- a/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml.cs b/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml.cs
deleted file mode 100644
index c12af39b76d..00000000000
--- a/packages/E2ETest/windows/ReactUWPTestApp/ReactTestPage.xaml.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using react.uwp;
-using System;
-using System.Collections.Generic;
-using Windows.UI.Xaml.Automation;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Navigation;
-
-namespace ReactUWPTestApp
-{
- public sealed partial class ReactTestPage : Page
- {
-#if BUNDLE
- private static readonly string JSFileName = "index.windows";
-#else
- private static readonly string JSFileName = "app/index";
-#endif
- private static readonly string JSComponentName = "ReactUWPTestApp";
- public ReactTestPage()
- {
- this.InitializeComponent();
- AutomationProperties.SetAutomationId(this, "ReactTestPage");
- LoadReact();
- }
-
- private void LoadReact()
- {
- InstanceSettings settings;
-#if BUNDLE
- settings.UseWebDebugger = false;
- settings.UseLiveReload = false;
-#else
- settings.UseWebDebugger = true;
- settings.UseLiveReload = true;
-#endif
- settings.EnableDeveloperMenu = false;
- var instance = Instance.Create(JSFileName);
-
- instance.Start(settings);
-
- RootElement.Instance = instance;
-
- RootElement.InitialProps = "{}";
- RootElement.JsComponentName = JSComponentName;
- RootElement.StartRender();
- }
-
- private void Reload_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
- {
- RootElement.StopRender();
- LoadReact();
- }
- }
-}
diff --git a/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj b/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj
index 940cc0ba392..37071e39d51 100644
--- a/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj
+++ b/packages/E2ETest/windows/ReactUWPTestApp/ReactUWPTestApp.csproj
@@ -89,7 +89,7 @@
true
true
-
+
$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\
@@ -99,9 +99,6 @@
App.xaml
-
- ReactTestPage.xaml
-
@@ -125,10 +122,6 @@
MSBuild:Compile
Designer
-
- Designer
- MSBuild:Compile
-
@@ -139,19 +132,19 @@
-
- {2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}
- ReactUWP
-
+
-
+
+ {f7d32bd0-2749-483e-9a0d-1635ef7e3136}
+ Microsoft.ReactNative
+
+
14.0
-
echo WorkingDir %CD%
@@ -159,7 +152,6 @@
-