| 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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 public MockWebRequest(String responseText) | 91 public MockWebRequest(String responseText) |
| 92 { | 92 { |
| 93 this.responseText = responseText; | 93 this.responseText = responseText; |
| 94 } | 94 } |
| 95 | 95 |
| 96 @Override | 96 @Override |
| 97 public ServerResponse httpGET(String url, List<HeaderEntry> headers) | 97 public ServerResponse httpGET(String url, List<HeaderEntry> headers) |
| 98 { | 98 { |
| 99 if (url.indexOf("/notification.json") < 0) | 99 if (url.indexOf("/notification.json") < 0) |
| 100 return new ServerResponse(); | 100 { |
| 101 return new ServerResponse(); |
| 102 } |
| 101 | 103 |
| 102 ServerResponse response = new ServerResponse(); | 104 ServerResponse response = new ServerResponse(); |
| 103 response.setStatus(ServerResponse.NsStatus.OK); | 105 response.setStatus(ServerResponse.NsStatus.OK); |
| 104 response.setResponseStatus(200); | 106 response.setResponseStatus(200); |
| 105 response.setResponse(responseText); | 107 response.setResponse(responseText); |
| 106 return response; | 108 return response; |
| 107 } | 109 } |
| 108 } | 110 } |
| 109 | 111 |
| 110 @Test | 112 @Test |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 159 |
| 158 Notification notification = peekNotification(""); | 160 Notification notification = peekNotification(""); |
| 159 assertNotNull(notification); | 161 assertNotNull(notification); |
| 160 | 162 |
| 161 Thread.sleep(1000); | 163 Thread.sleep(1000); |
| 162 notification.markAsShown(); | 164 notification.markAsShown(); |
| 163 | 165 |
| 164 assertNull(peekNotification("")); | 166 assertNull(peekNotification("")); |
| 165 } | 167 } |
| 166 } | 168 } |
| OLD | NEW |