Flutter Engine
PlatformViewGoldenTestManager.m
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #import <XCTest/XCTest.h>
8 
10 
11 @property(readwrite, strong, nonatomic) GoldenImage* goldenImage;
12 
13 @end
14 
15 @implementation PlatformViewGoldenTestManager
16 
17 NSDictionary* launchArgsMap;
18 
19 - (instancetype)initWithLaunchArg:(NSString*)launchArg {
20  self = [super init];
21  if (self) {
22  // The launchArgsMap should match the one in the `PlatformVieGoldenTestManager`.
23  static NSDictionary<NSString*, NSString*>* launchArgsMap;
24  static dispatch_once_t onceToken;
25  dispatch_once(&onceToken, ^{
26  launchArgsMap = @{
27  @"--platform-view" : @"platform_view",
28  @"--platform-view-multiple" : @"platform_view_multiple",
29  @"--platform-view-multiple-background-foreground" :
30  @"platform_view_multiple_background_foreground",
31  @"--platform-view-cliprect" : @"platform_view_cliprect",
32  @"--platform-view-cliprrect" : @"platform_view_cliprrect",
33  @"--platform-view-clippath" : @"platform_view_clippath",
34  @"--platform-view-transform" : @"platform_view_transform",
35  @"--platform-view-opacity" : @"platform_view_opacity",
36  @"--platform-view-rotate" : @"platform_view_rotate",
37  };
38  });
39  _identifier = launchArgsMap[launchArg];
40  NSString* prefix = [NSString stringWithFormat:@"golden_%@_", _identifier];
41  _goldenImage = [[GoldenImage alloc] initWithGoldenNamePrefix:prefix];
42  _launchArg = launchArg;
43  }
44  return self;
45 }
46 
47 @end
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol prefix
Definition: switches.h:59
NSDictionary * launchArgsMap