Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
tester.SkiaServeTester Class Reference

Public Member Functions

def __init__ (self, url, output_dir)
 
def set_skp (self, skp_dir, skp_name)
 
def info (self)
 
def post (self)
 
def cmd (self)
 
def img (self)
 
def enable_gpu (self)
 
def disable_gpu (self)
 
def opcount (self)
 
def batchList (self)
 

Public Attributes

 url
 
 output_dir
 
 skp
 
 skp_name
 

Detailed Description

Definition at line 41 of file tester.py.

Constructor & Destructor Documentation

◆ __init__()

def tester.SkiaServeTester.__init__ (   self,
  url,
  output_dir 
)

Definition at line 42 of file tester.py.

42 def __init__(self, url, output_dir):
43 self.url = url
44 self.output_dir = output_dir
45
46 # skp properties
47 self.skp = ''
48 self.skp_name = ''
49

Member Function Documentation

◆ batchList()

def tester.SkiaServeTester.batchList (   self)

Definition at line 84 of file tester.py.

84 def batchList(self):
85 path = self.output_dir + '/' + self.skp_name + '.batches.json'
86 return WriteJson(Check(requests.get(self.url + '/batches')), path)
87
def WriteJson(request, path)
Definition: tester.py:28
def Check(request)
Definition: tester.py:24

◆ cmd()

def tester.SkiaServeTester.cmd (   self)

Definition at line 64 of file tester.py.

64 def cmd(self):
65 path = self.output_dir + '/' + self.skp_name + '.cmd.json'
66 return WriteJson(Check(requests.get(self.url + '/cmd')), path)
67

◆ disable_gpu()

def tester.SkiaServeTester.disable_gpu (   self)

Definition at line 77 of file tester.py.

77 def disable_gpu(self):
78 return Check(requests.post(self.url + '/enableGPU/0'))
79

◆ enable_gpu()

def tester.SkiaServeTester.enable_gpu (   self)

Definition at line 74 of file tester.py.

74 def enable_gpu(self):
75 return Check(requests.post(self.url + '/enableGPU/1'))
76

◆ img()

def tester.SkiaServeTester.img (   self)

Definition at line 68 of file tester.py.

68 def img(self):
69 opcount = self.opcount()
70 url = self.url + '/img/' + str(opcount)
71 path = self.output_dir + '/' + self.skp_name + '.png'
72 return WritePng(Check(requests.get(url)), path)
73
def WritePng(request, path)
Definition: tester.py:35

◆ info()

def tester.SkiaServeTester.info (   self)

Definition at line 54 of file tester.py.

54 def info(self):
55 return Check(requests.get(self.url + '/info'))
56
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213

◆ opcount()

def tester.SkiaServeTester.opcount (   self)

Definition at line 80 of file tester.py.

80 def opcount(self):
81 r = self.cmd()
82 return len(r.json()['commands']) - 1 # why the minus 1 here?
83

◆ post()

def tester.SkiaServeTester.post (   self)

Definition at line 57 of file tester.py.

57 def post(self):
58 with open(self.skp, 'rb') as payload:
59 files = {'file': payload}
60
61 # upload skp
62 return Check(requests.post(self.url + '/new', files=files))
63

◆ set_skp()

def tester.SkiaServeTester.set_skp (   self,
  skp_dir,
  skp_name 
)

Definition at line 50 of file tester.py.

50 def set_skp(self, skp_dir, skp_name):
51 self.skp = skp_dir + '/' + skp_name
52 self.skp_name = skp_name
53

Member Data Documentation

◆ output_dir

tester.SkiaServeTester.output_dir

Definition at line 44 of file tester.py.

◆ skp

tester.SkiaServeTester.skp

Definition at line 47 of file tester.py.

◆ skp_name

tester.SkiaServeTester.skp_name

Definition at line 48 of file tester.py.

◆ url

tester.SkiaServeTester.url

Definition at line 43 of file tester.py.


The documentation for this class was generated from the following file: