| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/tracing/core/test_utils.html"> |
| <link rel="import" href="/tracing/extras/ads/domain_category.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| var DomainCategory = tr.e.ads.DomainCategory; |
| test('domainCategory', function() { |
| assert.equal( |
| 'Ads', |
| DomainCategory.fromDomain('https://parnter.googleadservices.com')); |
| assert.equal( |
| 'Analytics', |
| DomainCategory.fromDomain('https://x.adobetag.com')); |
| assert.equal( |
| 'Social', |
| DomainCategory.fromDomain('http://x.facebook.net')); |
| assert.equal( |
| 'Content Recommendation', |
| DomainCategory.fromDomain('http://xyz.outbrain.com')); |
| assert.equal( |
| 'Tracing', DomainCategory.fromDomain('chrome://tracing')); |
| assert.equal( |
| 'Extensions', |
| DomainCategory.fromDomain('chrome-extension://oiuy325oiu')); |
| assert.equal( |
| 'Other', |
| DomainCategory.fromDomain('http://xyz.outbrain.com.au')); |
| }); |
| }); |
| </script> |