Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ppapi/tests/test_instance_deprecated.h" | 5 #include "ppapi/tests/test_instance_deprecated.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/module.h" | 7 #include "ppapi/cpp/module.h" |
| 8 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" | 8 #include "ppapi/cpp/dev/scriptable_object_deprecated.h" |
| 9 #include "ppapi/tests/testing_instance.h" | 9 #include "ppapi/tests/testing_instance.h" |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 &exception); | 101 &exception); |
| 102 ASSERT_TRUE(ret.is_string() && ret.AsString() == "return value"); | 102 ASSERT_TRUE(ret.is_string() && ret.AsString() == "return value"); |
| 103 ASSERT_TRUE(exception.is_undefined()); | 103 ASSERT_TRUE(exception.is_undefined()); |
| 104 | 104 |
| 105 // Exception thrown by the plugin should be caught. | 105 // Exception thrown by the plugin should be caught. |
| 106 ret = instance_->ExecuteScript( | 106 ret = instance_->ExecuteScript( |
| 107 "document.getElementById('plugin').SetException('plugin exception');", | 107 "document.getElementById('plugin').SetException('plugin exception');", |
| 108 &exception); | 108 &exception); |
| 109 ASSERT_TRUE(ret.is_undefined()); | 109 ASSERT_TRUE(ret.is_undefined()); |
| 110 ASSERT_TRUE(exception.is_string()); | 110 ASSERT_TRUE(exception.is_string()); |
| 111 // TODO(brettw) bug 54011: The TryCatch isn't working properly and | 111 // Due to a limitation in the implementation of TryCatch, it doesn't actually |
| 112 // doesn't actually pass the exception text up. | 112 // get pass the strings up. Since this is a trusted only interface, we've |
|
dmichael (off chromium)
2011/12/08 18:39:08
nit: remove 'get '
| |
| 113 //ASSERT_TRUE(exception.AsString() == "plugin exception"); | 113 // decided not to bother fixing this for now. |
| 114 | 114 |
| 115 // Exception caused by string evaluation should be caught. | 115 // Exception caused by string evaluation should be caught. |
| 116 exception = pp::Var(); | 116 exception = pp::Var(); |
| 117 ret = instance_->ExecuteScript("document.doesntExist()", &exception); | 117 ret = instance_->ExecuteScript("document.doesntExist()", &exception); |
| 118 ASSERT_TRUE(ret.is_undefined()); | 118 ASSERT_TRUE(ret.is_undefined()); |
| 119 ASSERT_TRUE(exception.is_string()); // Don't know exactly what it will say. | 119 ASSERT_TRUE(exception.is_string()); // Don't know exactly what it will say. |
| 120 | 120 |
| 121 PASS(); | 121 PASS(); |
| 122 } | 122 } |
| OLD | NEW |