| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 test fixture. | 5 // Include test fixture. |
| 6 GEN_INCLUDE(['net_internals_test.js']); | 6 GEN_INCLUDE(['net_internals_test.js']); |
| 7 | 7 |
| 8 // Anonymous namespace | 8 // Anonymous namespace |
| 9 (function() { | 9 (function() { |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 // Tests with unmatched quotes. Unlike the strings above, combining them with | 208 // Tests with unmatched quotes. Unlike the strings above, combining them with |
| 209 // other filters is not the same as applying both filters independently. | 209 // other filters is not the same as applying both filters independently. |
| 210 checkFilter('"Quoted String', [true, false]); | 210 checkFilter('"Quoted String', [true, false]); |
| 211 checkFilter('"Quoted String source', [false, false]); | 211 checkFilter('"Quoted String source', [false, false]); |
| 212 checkFilter('Quoted" String', [true, false]); | 212 checkFilter('Quoted" String', [true, false]); |
| 213 checkFilter('Quoted" source', [false, false]); | 213 checkFilter('Quoted" source', [false, false]); |
| 214 checkFilter('Quoted "String', [true, false]); | 214 checkFilter('Quoted "String', [true, false]); |
| 215 | 215 |
| 216 // Test toggling sort method, without any filters. |
| 217 var eventsView = EventsView.getInstance(); |
| 218 eventsView.setFilterText_(''); |
| 219 $(EventsView.SORT_BY_DESCRIPTION_ID).click(); |
| 220 expectEquals('sort:desc', eventsView.getFilterText_()); |
| 221 $(EventsView.SORT_BY_DESCRIPTION_ID).click(); |
| 222 expectEquals('-sort:desc', eventsView.getFilterText_()); |
| 223 $(EventsView.SORT_BY_ID_ID).click(); |
| 224 expectEquals('sort:id', eventsView.getFilterText_()); |
| 225 |
| 226 // Sort by default is by ID, so toggling ID when there's no filter results in |
| 227 // sort:-id. |
| 228 eventsView.setFilterText_(''); |
| 229 $(EventsView.SORT_BY_ID_ID).click(); |
| 230 expectEquals('-sort:id', eventsView.getFilterText_()); |
| 231 $(EventsView.SORT_BY_ID_ID).click(); |
| 232 expectEquals('sort:id', eventsView.getFilterText_()); |
| 233 |
| 234 // Test toggling sort method with filters. |
| 235 eventsView.setFilterText_('text'); |
| 236 $(EventsView.SORT_BY_ID_ID).click(); |
| 237 expectEquals('-sort:id text', eventsView.getFilterText_()); |
| 238 $(EventsView.SORT_BY_ID_ID).click(); |
| 239 expectEquals('sort:id text', eventsView.getFilterText_()); |
| 240 $(EventsView.SORT_BY_SOURCE_TYPE_ID).click(); |
| 241 expectEquals('sort:source text', eventsView.getFilterText_()); |
| 242 eventsView.setFilterText_('text sort:id "more text"'); |
| 243 $(EventsView.SORT_BY_ID_ID).click(); |
| 244 expectEquals('-sort:id text "more text"', eventsView.getFilterText_()); |
| 245 |
| 216 testDone(); | 246 testDone(); |
| 217 }); | 247 }); |
| 218 | 248 |
| 219 })(); // Anonymous namespace | 249 })(); // Anonymous namespace |
| OLD | NEW |