Skip to content

Commit

Permalink
[infra] Move IE registry settings from Puppet to the test runner
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
athomas committed Dec 9, 2019
1 parent de11b7b commit 7fcaafb
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions pkg/test_runner/lib/src/browser_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,15 @@ class IE extends Browser {
// resetBrowserConfiguration flag is set.
Future<bool> resetConfiguration() async {
if (!Browser.resetBrowserConfiguration) return true;
// todo(athom) Move this into the puppet configuration
var args = [
"add",
r"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow",
"/v",
"127.0.0.1",
"/f"
];
var result = await Process.run("reg", args);
if (result.exitCode != 0) {
_logEvent("Failed to override user popup blocker settings");
}
const ieKey = r"HKCU\Software\Microsoft\Internet Explorer";
// Turn off popup blocker
await _setRegistryKey("$ieKey\\New Windows", "PopupMgr",
data: "0", type: "REG_DWORD");
// Allow popups from localhost
await _setRegistryKey("$ieKey\\New Windows\\Allow", "127.0.0.1");
// Disable IE first run wizard
await _setRegistryKey("$ieKey\Main", "DisableFirstRunCustomize",
data: "1", type: "REG_DWORD");

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

String toString() => "IE";

Future<void> _setRegistryKey(String key, String value,
{String data, String type}) async {
var args = <String>[
"add",
key,
"/v",
value,
"/f",
if (type != null) ...["/t", type]
];
var result = await Process.run("reg", args);
if (result.exitCode != 0) {
_logEvent("Failed to set '$key' to '$value'");
}
}
}

class AndroidChrome extends Browser {
Expand Down

0 comments on commit 7fcaafb

Please sign in to comment.