Skip to content

Commit 2c5d9de

Browse files
committed
Update test procedure
1 parent 1e7bfd9 commit 2c5d9de

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[TARGETS]
2+
*://localhost:8080*

doc/verify/sources/TestTools/form.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@
77
<body>
88
<h1>フォーム再送信サンプル</h1>
99
<p>送信ボタンを押下後、リロードすると「フォームを再送信しますか?」ダイアログが表示されます。</p>
10-
<form method="POST">
10+
<p>送信ボタンを押下後、ブラウザの「戻る」「進む」を実行すると、「フォームを再送信しますか?」(ERR_CACHE_MISS)エラーページが表示されます。</p>
11+
<form method="POST" action="http://localhost:8080">
1112
<label>名前: <input type="text" name="name"></label>
1213
<button type="submit">送信</button>
1314
</form>
14-
<p>本フォームは自分自身にデータ送信するため、外部にはデータ送信はしません。</p>
15+
<p>本フォームは外部にはデータ送信しません。</p>
16+
<button id="openFormBtn">フォームをダイアログで開く</button>
17+
18+
<script>
19+
document.getElementById('openFormBtn').addEventListener('click', function() {
20+
window.open('form.html',
21+
'formWindow',
22+
'width=500,height=400,resizable=yes,scrollbars=yes'
23+
);});
24+
</script>
1525
</body>
1626
</html>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Add-Type -AssemblyName System.Net
2+
3+
$listener = New-Object System.Net.HttpListener
4+
$listener.Prefixes.Add("http://localhost:8080/")
5+
$listener.Start()
6+
Write-Host "HTTP サーバー起動中: http://localhost:8080/"
7+
8+
while ($listener.IsListening) {
9+
try {
10+
$context = $listener.GetContext()
11+
$response = $context.Response
12+
$request = $context.Request
13+
14+
# キャッシュ無効化ヘッダー
15+
$response.Headers.Add("Cache-Control", "no-store, no-cache, must-revalidate")
16+
$response.Headers.Add("Pragma", "no-cache")
17+
$response.ContentType = "text/html"
18+
19+
$html = @"
20+
<!DOCTYPE html>
21+
<html>
22+
<head><title>PowerShell HTTP Server</title></head>
23+
<body>
24+
<h1>No cached page</h1>
25+
<p>This page is not cached</p>
26+
</body>
27+
</html>
28+
"@
29+
30+
$buffer = [System.Text.Encoding]::UTF8.GetBytes($html)
31+
$response.ContentLength64 = $buffer.Length
32+
$response.OutputStream.Write($buffer, 0, $buffer.Length)
33+
$response.OutputStream.Close()
34+
} catch {
35+
Write-Warning "エラー: $_"
36+
}
37+
}

0 commit comments

Comments
 (0)