Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7fcaafb

Browse files
committed
[infra] Move IE registry settings from Puppet to the test runner
Removing puppet rules allows GCE VMs to be provisioned without Puppet. This will reduce the startup time for new GCE VMs. Bug: https://crbug.com/871818 Change-Id: I33d9ff9ccf423d5291b94b74b2e86a6cb757b976 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127241 Reviewed-by: William Hesse <whesse@google.com>
1 parent de11b7b commit 7fcaafb

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

pkg/test_runner/lib/src/browser_controller.dart

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -515,18 +515,15 @@ class IE extends Browser {
515515
// resetBrowserConfiguration flag is set.
516516
Future<bool> resetConfiguration() async {
517517
if (!Browser.resetBrowserConfiguration) return true;
518-
// todo(athom) Move this into the puppet configuration
519-
var args = [
520-
"add",
521-
r"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow",
522-
"/v",
523-
"127.0.0.1",
524-
"/f"
525-
];
526-
var result = await Process.run("reg", args);
527-
if (result.exitCode != 0) {
528-
_logEvent("Failed to override user popup blocker settings");
529-
}
518+
const ieKey = r"HKCU\Software\Microsoft\Internet Explorer";
519+
// Turn off popup blocker
520+
await _setRegistryKey("$ieKey\\New Windows", "PopupMgr",
521+
data: "0", type: "REG_DWORD");
522+
// Allow popups from localhost
523+
await _setRegistryKey("$ieKey\\New Windows\\Allow", "127.0.0.1");
524+
// Disable IE first run wizard
525+
await _setRegistryKey("$ieKey\Main", "DisableFirstRunCustomize",
526+
data: "1", type: "REG_DWORD");
530527

531528
var localAppData = Platform.environment['LOCALAPPDATA'];
532529
Directory dir = Directory("$localAppData\\Microsoft\\"
@@ -548,6 +545,22 @@ class IE extends Browser {
548545
}
549546

550547
String toString() => "IE";
548+
549+
Future<void> _setRegistryKey(String key, String value,
550+
{String data, String type}) async {
551+
var args = <String>[
552+
"add",
553+
key,
554+
"/v",
555+
value,
556+
"/f",
557+
if (type != null) ...["/t", type]
558+
];
559+
var result = await Process.run("reg", args);
560+
if (result.exitCode != 0) {
561+
_logEvent("Failed to set '$key' to '$value'");
562+
}
563+
}
551564
}
552565

553566
class AndroidChrome extends Browser {

0 commit comments

Comments
 (0)