Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: sky/tests/raw/color_bounds.dart

Issue 1179413008: If Color constructor is passed a value > 0xFFFFFFFF, Sky crashes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Now with tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/painting/Color.dart ('k') | sky/tests/raw/color_bounds-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import 'dart:sky' as sky;
2
3 import '../resources/third_party/unittest/unittest.dart';
4 import '../resources/unit.dart';
5
6 void main() {
7 initUnit();
8
9 test("paint set to black", () {
10 sky.Color c = new sky.Color(0x00000000);
11 sky.Paint p = new sky.Paint();
12 p.color = c;
13 expect(c.toString(), equals('Color(0x00000000)'));
14 });
15
16 test("color created with out of bounds value", () {
17 try {
18 sky.Color c = new sky.Color(0x100 << 24);
19 sky.Paint p = new sky.Paint();
20 p.color = c;
21 } catch (e) {
22 expect(e != null, equals(true));
23 }
24 });
25
26 test("color created with wildly out of bounds value", () {
27 try {
28 sky.Color c = new sky.Color(1 << 1000000);
29 sky.Paint p = new sky.Paint();
30 p.color = c;
31 } catch (e) {
32 expect(e != null, equals(true));
33 }
34 });
35 }
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Color.dart ('k') | sky/tests/raw/color_bounds-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698