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

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

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month 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
1 # Copyright 2015 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import unittest 5 import unittest
6 6
7 import module as mojom 7 import module as mojom
8 import generator 8 import generator
9 9
10 class TestGenerator(unittest.TestCase): 10 class TestGenerator(unittest.TestCase):
11 11
12 def testGetUnionsAddsOrdinals(self): 12 def testGetUnionsAddsOrdinals(self):
13 module = mojom.Module() 13 module = mojom.Module()
14 union = module.AddUnion('a') 14 union = module.AddUnion('a')
15 union.AddField('a', mojom.BOOL) 15 union.AddField('a', mojom.BOOL)
16 union.AddField('b', mojom.BOOL) 16 union.AddField('b', mojom.BOOL)
17 union.AddField('c', mojom.BOOL, ordinal=10) 17 union.AddField('c', mojom.BOOL, ordinal=10)
18 union.AddField('d', mojom.BOOL) 18 union.AddField('d', mojom.BOOL)
19 19
20 gen = generator.Generator(module) 20 gen = generator.Generator(module)
21 union = gen.GetUnions()[0] 21 union = gen.GetUnions()[0]
22 ordinals = [field.ordinal for field in union.fields] 22 ordinals = [field.ordinal for field in union.fields]
23 23
24 self.assertEquals([0, 1, 10, 11], ordinals) 24 self.assertEquals([0, 1, 10, 11], ordinals)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698