|
58 | 58 | print("test_function() ok"); |
59 | 59 |
|
60 | 60 | // Test binding property: test_property1 |
61 | | - if (test_property1 == "Test binding property to the 'window' object") { |
| 61 | + if (test_property1 === "Test binding property to the 'window' object") { |
62 | 62 | print("test_property_1 ok"); |
63 | 63 | } else { |
64 | 64 | throw new Error("test_property1 contains invalid string"); |
65 | 65 | } |
66 | 66 |
|
67 | 67 | // Test binding property: test_property2 |
68 | | - if (JSON.stringify(test_property2) == '{"key1":"Test binding property'+ |
69 | | - ' to the \\'window\\' object","key2":["Inside list",1,2]}') { |
| 68 | + if (JSON.stringify(test_property2) === '{"key1":"Test binding property'+ |
| 69 | + ' to the \\'window\\' object","key2":["Inside list",2147483647,"2147483648"]}') { |
70 | 70 | print("test_property2 ok"); |
71 | 71 | } else { |
| 72 | + print("test_property2 invalid value: " + JSON.stringify(test_property2)); |
72 | 73 | throw new Error("test_property2 contains invalid value"); |
73 | 74 | } |
74 | 75 |
|
|
81 | 82 | print("[TIMER] Call Python function and then js callback that was"+ |
82 | 83 | " passed (Issue #277 test)"); |
83 | 84 | external.test_callbacks(function(msg_from_python, py_callback){ |
84 | | - if (msg_from_python == "String sent from Python") { |
| 85 | + if (msg_from_python === "String sent from Python") { |
85 | 86 | print("test_callbacks() ok"); |
86 | 87 | var execution_time = new Date().getTime() - start_time; |
87 | 88 | print("[TIMER]: Elapsed = "+String(execution_time)+" ms"); |
@@ -163,15 +164,23 @@ def test_main(self): |
163 | 164 | cef.LoadCrlSetsFile(crlset) |
164 | 165 | subtest_message("cef.LoadCrlSetsFile ok") |
165 | 166 |
|
166 | | - # High DPI on Windows |
| 167 | + # High DPI on Windows. |
| 168 | + # Setting DPI awareness from Python is usually too late and should be done |
| 169 | + # via manifest file. Alternatively change python.exe properties > Compatibility |
| 170 | + # > High DPI scaling override > Application. |
| 171 | + # Using cef.DpiAware.EnableHighDpiSupport is problematic, it can cause |
| 172 | + # display glitches. |
167 | 173 | if WINDOWS: |
168 | 174 | self.assertIsInstance(cef.DpiAware.GetSystemDpi(), tuple) |
169 | 175 | window_size = cef.DpiAware.CalculateWindowSize(800, 600) |
170 | 176 | self.assertIsInstance(window_size, tuple) |
171 | 177 | self.assertGreater(window_size[0], 0) |
172 | 178 | self.assertGreater(cef.DpiAware.Scale((800, 600))[0], 0) |
173 | | - cef.DpiAware.EnableHighDpiSupport() |
174 | | - self.assertTrue(cef.DpiAware.IsProcessDpiAware()) |
| 179 | + |
| 180 | + # OFF - see comments above. |
| 181 | + # cef.DpiAware.EnableHighDpiSupport() |
| 182 | + # self.assertTrue(cef.DpiAware.IsProcessDpiAware()) |
| 183 | + |
175 | 184 | # Make some calls again after DPI Aware was set |
176 | 185 | self.assertIsInstance(cef.DpiAware.GetSystemDpi(), tuple) |
177 | 186 | self.assertGreater(cef.DpiAware.Scale([800, 600])[0], 0) |
@@ -374,9 +383,10 @@ def __init__(self, test_case): |
374 | 383 | self.test_case = test_case |
375 | 384 |
|
376 | 385 | # Test binding properties to the 'window' object. |
| 386 | + # 2147483648 is out of INT_MAX limit and will be sent to JS as string value. |
377 | 387 | self.test_property1 = "Test binding property to the 'window' object" |
378 | 388 | self.test_property2 = {"key1": self.test_property1, |
379 | | - "key2": ["Inside list", 1, 2]} |
| 389 | + "key2": ["Inside list", 2147483647, 2147483648]} |
380 | 390 |
|
381 | 391 | # Asserts for True/False will be checked just before shutdown |
382 | 392 | self.test_for_True = True # Test whether asserts are working correctly |
|
0 commit comments