| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public class NotificationTest extends BaseFilterEngineTest | 27 public class NotificationTest extends BaseFilterEngineTest |
| 28 { | 28 { |
| 29 @Override | 29 @Override |
| 30 protected WebRequest createWebRequest() | 30 protected WebRequest createWebRequest() |
| 31 { | 31 { |
| 32 return new LazyWebRequest(); | 32 return new LazyWebRequest(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 protected void addNotification(String notification) | 35 protected void addNotification(String notification) |
| 36 { | 36 { |
| 37 jsEngine.evaluate( | 37 platform.getJsEngine().evaluate( |
| 38 "(function()\n" + | 38 "(function()\n" + |
| 39 "{\n" + | 39 "{\n" + |
| 40 "require('notification').Notification.addNotification(" + notification + "
);\n" + | 40 "require('notification').Notification.addNotification(" + notification + "
);\n" + |
| 41 "})();"); | 41 "})();"); |
| 42 } | 42 } |
| 43 | 43 |
| 44 private class LocalShowNotificationCallback extends ShowNotificationCallback | 44 private class LocalShowNotificationCallback extends ShowNotificationCallback |
| 45 { | 45 { |
| 46 private Notification retValue; | 46 private Notification retValue; |
| 47 | 47 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 Notification notification = peekNotification(""); | 117 Notification notification = peekNotification(""); |
| 118 assertNotNull(notification); | 118 assertNotNull(notification); |
| 119 | 119 |
| 120 Thread.sleep(1000); | 120 Thread.sleep(1000); |
| 121 notification.markAsShown(); | 121 notification.markAsShown(); |
| 122 | 122 |
| 123 assertNull(peekNotification("")); | 123 assertNull(peekNotification("")); |
| 124 } | 124 } |
| 125 } | 125 } |
| OLD | NEW |