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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/generate/generator_unittest.py

Issue 2863353002: Mojo code generator: change where to add computed data to mojom definitions (Closed)
Patch Set: . Created 3 years, 7 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
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium 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 import unittest
6
7 import module as mojom
8 import generator
9
10 class TestGenerator(unittest.TestCase):
11
12 def testGetUnionsAddsOrdinals(self):
13 module = mojom.Module()
14 union = module.AddUnion('a')
15 union.AddField('a', mojom.BOOL)
16 union.AddField('b', mojom.BOOL)
17 union.AddField('c', mojom.BOOL, ordinal=10)
18 union.AddField('d', mojom.BOOL)
19
20 gen = generator.Generator(module)
21 union = gen.GetUnions()[0]
22 ordinals = [field.ordinal for field in union.fields]
23
24 self.assertEquals([0, 1, 10, 11], ordinals)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698