Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GoldenTestManager.h
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
5#ifndef FLUTTER_TESTING_SCENARIO_APP_IOS_SCENARIOS_SCENARIOSUITESTS_GOLDENTESTMANAGER_H_
6#define FLUTTER_TESTING_SCENARIO_APP_IOS_SCENARIOS_SCENARIOSUITESTS_GOLDENTESTMANAGER_H_
7
8#import <Foundation/Foundation.h>
9#import <XCTest/XCTest.h>
10#import "GoldenImage.h"
11
13
14extern NSDictionary* launchArgsMap;
15const extern double kDefaultRmseThreshold;
16
17// Manages a `GoldenPlatformViewTests`.
18//
19// It creates the correct `identifer` based on the `launchArg`.
20// It also generates the correct GoldenImage based on the `identifier`.
21@interface GoldenTestManager : NSObject
22
23@property(readonly, strong, nonatomic) GoldenImage* goldenImage;
24@property(readonly, copy, nonatomic) NSString* identifier;
25@property(readonly, copy, nonatomic) NSString* launchArg;
26
27// Initilize with launchArg.
28//
29// Crahes if the launchArg is not mapped in `Appdelegate.launchArgsMap`.
30- (instancetype)initWithLaunchArg:(NSString*)launchArg;
31
32// Take a sceenshot of the test app and check it has the same pixels with
33// goldenImage inside the `GoldenTestManager`.
34- (void)checkGoldenForTest:(XCTestCase*)test rmesThreshold:(double)rmesThreshold;
35
36@end
37
39
40#endif // FLUTTER_TESTING_SCENARIO_APP_IOS_SCENARIOS_SCENARIOSUITESTS_GOLDENTESTMANAGER_H_
#define NS_ASSUME_NONNULL_BEGIN
Definition: FlutterMacros.h:19
#define NS_ASSUME_NONNULL_END
Definition: FlutterMacros.h:20
NS_ASSUME_NONNULL_BEGIN NSDictionary * launchArgsMap
const double kDefaultRmseThreshold
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
Definition: SkSwizzler.cpp:31
GoldenImage * goldenImage