Beispiel #1
0
    def test_get_properties_returns_properties_of_simple_object(self):
        mock_props = {"result": [{"name": "foo", "value": {"type": "undefined"}}]}

        test_object = MockRemoteObject()
        test_object.properties = mock_props

        self.debugger_store.remote_object_manager.add_object(test_object)
        result = self.runtime_domain.getProperties({"objectId": test_object.id})
        self.assertEqual(mock_props, result)
Beispiel #2
0
    def test_get_properties_returns_properties_of_simple_object(self):
        mock_props = {
            'result': [{'name': 'foo', 'value': {'type': 'undefined'}}],
        }

        test_object = MockRemoteObject()
        test_object.properties = mock_props

        self.remote_object_manager.add_object(test_object)
        result = self.runtime_domain.getProperties({
            'objectId': test_object.id
        })
        self.assertEqual(mock_props, result)
Beispiel #3
0
    def test_get_properties_returns_properties_of_simple_object(self):
        mock_props = {
            'result': [{'name': 'foo', 'value': {'type': 'undefined'}}],
        }

        test_object = MockRemoteObject()
        test_object.properties = mock_props

        self.remote_object_manager.add_object(test_object)
        result = self.runtime_domain.getProperties({
            'objectId': test_object.id
        })
        self.assertEqual(mock_props, result)
Beispiel #4
0
 def test_get_add_object_func_adds_object_to_given_group(self):
     add_to_test_group = self.remote_object_manager.get_add_object_func(
         'test')
     obj_test = add_to_test_group(MockRemoteObject())
     self.assertIs(self.remote_object_manager.get_object(obj_test.id),
                   obj_test)
     self.remote_object_manager.release_object_group('test')
     self.assertIsNone(self.remote_object_manager.get_object(obj_test.id))
Beispiel #5
0
 def test_can_release_object_group(self):
     obj_test_1 = self.remote_object_manager.add_object(
         MockRemoteObject(), 'test')
     obj_test_2 = self.remote_object_manager.add_object(
         MockRemoteObject(), 'test')
     obj_not_test = self.remote_object_manager.add_object(
         MockRemoteObject(), 'not_test')
     self.assertIs(self.remote_object_manager.get_object(obj_test_1.id),
                   obj_test_1)
     self.assertIs(self.remote_object_manager.get_object(obj_test_2.id),
                   obj_test_2)
     self.assertIs(self.remote_object_manager.get_object(obj_not_test.id),
                   obj_not_test)
     self.remote_object_manager.release_object_group('test')
     self.assertIsNone(self.remote_object_manager.get_object(obj_test_1.id))
     self.assertIsNone(self.remote_object_manager.get_object(obj_test_2.id))
     self.assertIsNotNone(
         self.remote_object_manager.get_object(obj_not_test.id))
 def test_reset_callstack_object_group_on_stop(self):
     self.lldb_debugger.SetAsync(False)
     self.lldb_debugger.GetSelectedTarget().LaunchSimple(
         None, None, os.getcwd())
     obj = self.remote_object_manager.add_object(MockRemoteObject(),
                                                 CALL_STACK_OBJECT_GROUP)
     self.assertIsNotNone(self.remote_object_manager.get_object(obj.id),
                          "Object should exist in remote_object_manager")
     self.debugger.handle('enable', {})
     self.assertIsNone(
         self.remote_object_manager.get_object(obj.id),
         "Object should no longer exist in remote_object_manager")
    def test_reset_callstack_object_group_on_stop(self):
        self.launch_debugging(stop_at_entry=True)
        self.wait_for_process_stop()
        self.debugger.handle('enable', {})
        self.debugger.handle('setBreakpointByUrl', {
            'lineNumber': 13,
            'url': 'file://' + os.path.realpath(self.__class__.test_executable.source_path)
        })
        obj = self.debugger_store.remote_object_manager.add_object(
            MockRemoteObject(),
            CALL_STACK_OBJECT_GROUP)
        self.assertIsNotNone(
            self.debugger_store.remote_object_manager.get_object(obj.id),
            "Object should exist in remote_object_manager")

        # Resume and hit next stop.
        self.debugger.handle('resume', {})
        self.wait_for_process_running()
        self.wait_for_process_stop()

        self.assertIsNone(
            self.debugger_store.remote_object_manager.get_object(obj.id),
            "Object should no longer exist in remote_object_manager")
Beispiel #8
0
 def test_can_add_and_retrieve_object(self):
     obj = self.remote_object_manager.add_object(MockRemoteObject())
     self.assertIsInstance(obj, RemoteObject)
     self.assertIs(self.remote_object_manager.get_object(obj.id), obj)