Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/Components/Web.JS/dist/Release/blazor.webassembly.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ async function getCacheToUseIfEnabled(bootConfig: BootJsonData): Promise<Cache |
return null;
}

// cache integrity is compromised if the first request has been served over http
// cache integrity is compromised if the first request has been served over http (except localhost)
// in this case, we want to disable caching and integrity validation
if (document.location.protocol !== 'https:') {
if (window.isSecureContext === false) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,12 @@ public ServerInputFileTest(BrowserFixture browserFixture, ToggleExecutionModeSer
{
}
}

public class ServerVirtualizationTest : VirtualizationTest
{
public ServerVirtualizationTest(BrowserFixture browserFixture, ToggleExecutionModeServerFixture<Program> serverFixture, ITestOutputHelper output)
: base(browserFixture, serverFixture.WithServerExecution(), output)
{
}
}
}
10 changes: 5 additions & 5 deletions src/Components/test/E2ETest/Tests/BootResourceCachingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ public void IncrementallyUpdatesCache()
Navigate("/");
WaitUntilLoaded();
var cacheEntryUrls1 = GetCacheEntryUrls();
var cacheEntryForMsCorLib = cacheEntryUrls1.Single(url => url.Contains("/mscorlib.dll"));
var cacheEntryForComponentsDll = cacheEntryUrls1.Single(url => url.Contains("/Microsoft.AspNetCore.Components.dll"));
var cacheEntryForDotNetWasm = cacheEntryUrls1.Single(url => url.Contains("/dotnet.wasm"));
var cacheEntryForDotNetWasmWithChangedHash = cacheEntryForDotNetWasm.Replace(".sha256-", ".sha256-different");

// Remove some items we do need, and add an item we don't need
RemoveCacheEntry(cacheEntryForMsCorLib);
RemoveCacheEntry(cacheEntryForComponentsDll);
RemoveCacheEntry(cacheEntryForDotNetWasm);
AddCacheEntry(cacheEntryForDotNetWasmWithChangedHash, "ignored content");
var cacheEntryUrls2 = GetCacheEntryUrls();
Assert.DoesNotContain(cacheEntryForMsCorLib, cacheEntryUrls2);
Assert.DoesNotContain(cacheEntryForComponentsDll, cacheEntryUrls2);
Assert.DoesNotContain(cacheEntryForDotNetWasm, cacheEntryUrls2);
Assert.Contains(cacheEntryForDotNetWasmWithChangedHash, cacheEntryUrls2);

Expand All @@ -91,13 +91,13 @@ public void IncrementallyUpdatesCache()
WaitUntilLoaded();
var subsequentResourcesRequested = GetAndClearRequestedPaths();
Assert.Collection(subsequentResourcesRequested.Where(url => url.Contains(".dll")),
requestedDll => Assert.Contains("/mscorlib.dll", requestedDll));
requestedDll => Assert.Contains("/Microsoft.AspNetCore.Components.dll", requestedDll));
Assert.Collection(subsequentResourcesRequested.Where(url => url.Contains(".wasm")),
requestedDll => Assert.Contains("/dotnet.wasm", requestedDll));

// We also update the cache (add new items, remove unnecessary items)
var cacheEntryUrls3 = GetCacheEntryUrls();
Assert.Contains(cacheEntryForMsCorLib, cacheEntryUrls3);
Assert.Contains(cacheEntryForComponentsDll, cacheEntryUrls3);
Assert.Contains(cacheEntryForDotNetWasm, cacheEntryUrls3);
Assert.DoesNotContain(cacheEntryForDotNetWasmWithChangedHash, cacheEntryUrls3);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.AspNetCore.Components.E2ETests.Tests
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
{
public class ClientRenderingMultpleComponentsTest : ServerTestBase<BasicTestAppServerSiteFixture<MultipleComponents>>
{
Expand Down
3 changes: 1 addition & 2 deletions src/Components/test/E2ETest/Tests/HeadComponentsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@

using System.Linq;
using BasicTestApp;
using Microsoft.AspNetCore.Components.E2ETest;
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
using Microsoft.AspNetCore.E2ETesting;
using OpenQA.Selenium;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.AspNetCore.Components.E2ETests.Tests
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
{
public class HeadComponentsTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
{
Expand Down
7 changes: 3 additions & 4 deletions src/Components/test/E2ETest/Tests/VirtualizationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using BasicTestApp;
using Microsoft.AspNetCore.Components.E2ETest;
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
using Microsoft.AspNetCore.E2ETesting;
Expand All @@ -12,7 +11,7 @@
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.AspNetCore.Components.E2ETests.Tests
namespace Microsoft.AspNetCore.Components.E2ETest.Tests
{
public class VirtualizationTest : ServerTestBase<ToggleExecutionModeServerFixture<Program>>
{
Expand Down Expand Up @@ -121,7 +120,7 @@ public void RerendersWhenItemSizeShrinks_Sync()
var itemSizeInput = Browser.FindElement(By.Id("item-size-input"));

// Change the item size.
itemSizeInput.SendKeys("\b\b\b50\n");
itemSizeInput.SendKeys("\b\b\b10\n");

// Validate that the list has been re-rendered to show more items.
Browser.True(() => GetItemCount() > initialItemCount);
Expand All @@ -146,7 +145,7 @@ public void RerendersWhenItemSizeShrinks_Async()
var itemSizeInput = Browser.FindElement(By.Id("item-size-input"));

// Change the item size.
itemSizeInput.SendKeys("\b\b\b50\n");
itemSizeInput.SendKeys("\b\b\b10\n");

// Validate that the same number of loaded items is rendered.
Browser.Equal(initialItemCount, GetItemCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc();
services.AddServerSideBlazor();
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
services.AddSingleton<LazyAssemblyLoader>();
services.AddScoped<LazyAssemblyLoader>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
Expand Down