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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py b/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py
deleted file mode 100644
index 75b7cd54377bf59bf1abd6c723f29cc1194287f1..0000000000000000000000000000000000000000
--- a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom_tests/generate/module_unittest.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import imp
-import os.path
-import sys
-import unittest
-
-def _GetDirAbove(dirname):
- """Returns the directory "above" this file containing |dirname| (which must
- also be "above" this file)."""
- path = os.path.abspath(__file__)
- while True:
- path, tail = os.path.split(path)
- assert tail
- if tail == dirname:
- return path
-
-try:
- imp.find_module("mojom")
-except ImportError:
- sys.path.append(os.path.join(_GetDirAbove("pylib"), "pylib"))
-from mojom.generate import module as mojom
-
-
-class ModuleTest(unittest.TestCase):
-
- def testNonInterfaceAsInterfaceRequest(self):
- """Tests that a non-interface cannot be used for interface requests."""
- module = mojom.Module('test_module', 'test_namespace')
- struct = mojom.Struct('TestStruct', module=module)
- with self.assertRaises(Exception) as e:
- mojom.InterfaceRequest(struct)
- self.assertEquals(
- e.exception.__str__(),
- 'Interface request requires \'x:TestStruct\' to be an interface.')
-
- def testNonInterfaceAsAssociatedInterface(self):
- """Tests that a non-interface type cannot be used for associated interfaces.
- """
- module = mojom.Module('test_module', 'test_namespace')
- struct = mojom.Struct('TestStruct', module=module)
- with self.assertRaises(Exception) as e:
- mojom.AssociatedInterface(struct)
- self.assertEquals(
- e.exception.__str__(),
- 'Associated interface requires \'x:TestStruct\' to be an interface.')

Powered by Google App Engine
This is Rietveld 408576698