This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1078202 - Switch topsites customiser to write places directly. r=…
…kgrandon
- Loading branch information
1 parent
f81d4c5
commit 29c271e
Showing
6 changed files
with
122 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* global MockNavigatorDatastore */ | ||
/* global MockDatastore */ | ||
/* global topSitesCustomizer */ | ||
|
||
'use strict'; | ||
|
||
requireApp('operatorvariant/js/customizers/customizer.js'); | ||
requireApp('operatorvariant/js/customizers/topsites_customizer.js'); | ||
require('/shared/test/unit/mocks/mock_navigator_datastore.js'); | ||
|
||
suite('TopSitesCustomizer >', function() { | ||
var realDatastore = null; | ||
|
||
suiteSetup(function() { | ||
navigator.getDataStores = MockNavigatorDatastore.getDataStores; | ||
}); | ||
|
||
suiteTeardown(function() { | ||
navigator.getDataStores = realDatastore; | ||
}); | ||
|
||
teardown(function() { | ||
MockDatastore._inError = false; | ||
MockDatastore._records = Object.create(null); | ||
}); | ||
|
||
test('First run with valid SIM. Set places', function(done) { | ||
|
||
var url = 'http://example.org'; | ||
var title = 'Example'; | ||
var tile = 'atile'; | ||
var data = { | ||
topSites: [{ | ||
url: url, | ||
title: title, | ||
tile: tile, | ||
}] | ||
}; | ||
|
||
MockDatastore.addEventListener('change', function() { | ||
assert.deepEqual(MockDatastore._records[url], { | ||
url: url, | ||
title: title, | ||
tile: tile, | ||
frecency: -1 | ||
}, 'Arguments not equal'); | ||
done(); | ||
}); | ||
topSitesCustomizer.simPresentOnFirstBoot = true; | ||
topSitesCustomizer.set(data); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<header><h1>Mozilla</h1></header> | ||
<section>We are global community with a common purpose</section> | ||
</body> | ||
</html> |