# This system set up a unite server which will publish the folder 
# "modules/applicationcache/selftest/cache_tests/data/public_html" on the url path 
# "http://localhost:port/applicationcache" where port normally is 8840. The unite server runs
# in the selftest html window opened up by selftest. 
#
# The system will load up one by one the html files listed in this file, and show them in a separate page.
# 
# We have loosen the security restrictions using OpSecurityManager::PrivilegedBlock
# 
# Since the tests are run using window.open, the test windows have direct access 
# to the webserver interface through 'window.opener.opera.io.webserver'. Thus the browser client 
# can control the webserver directly in addition to performing normal http requests to the same server.
# 
# If test windows add resources to the webserver, this should be done in the <body onload="setupwebserver();">, since
# since setupwebserver() are guaranteed to be run before the html document is parsed. Thus, the server will be ready
# to respond to requests, when the inlines in the page starts loading.
#
# All static files that have the extions ".mst" or ".manifest" will be served with content type "text/cache-manifest".
# All dynamic files (produced by a server javascript resource) must add the mime type manually using
# e.connection.response.setResponseHeader("Content-Type", "text/cache-manifest"); in the listener function.
#
# 
# There is a timeout of 10 seconds, in case loading the test fails. The timeout can be extended or made shorter by 
# calling window.opener.resetTimeout(milliseconds);
# 
# Success or failure is signaled back to the test system using  window.opener.verifyTest(window, success,reason_for_failure), 
# where success is a boolean and reason_for_failure is a text string.
#
# If an error happens and the test is not able to send back a verifyTest callback, the test will time out in 5 seconds.
#
# Format of file is:
#
# Deprecated: <file.html>,<number of times to repeat the test>
# 
# The number of times to repeat test is deprecated. Use the new function  window.opener.setTimesToRepeat(int:  repeat) instead

# The new format
# <file.html>
# .
# .
# <file2.html>
# <file3.html>
#
#
# In the html file, these global functions and variables are accessible:
# 
# window.opener.verifyTest(Window: window, bool: success,string: report_text);  // report back to selftest system wether this was a success or failure, and close the test page.
# window.opener.resetTimeout(int: milliseconds); // resets the timeout. Mostly used for debugging.
# window.opener.setTimesToRepeat(int:  repeat); // number of times to repeat the test. Thus, setTimesToRepeat(2) will load the test 3 times.
# window.opener.getTestCount() // a function that counts the number of repeats of the current test. on first run 0 will be returned.
# window.opener.pauseWebserver() // will pause the unite webserver (basically turn it off temporarely)
# window.opener.wakeUpWebserver() // will turn the unite webserver back on
# window.opener.checkWebserverStatus() //  will return true if the webserver is listening (is online).
#
# The webserver can be accessed directly using the webserver object
# window.opener.opera.io.webserver
#
# run these selftests with
# gogi-binary test=offline_app.update_algorithm 
# or 
# by starting gogi, choose run-selftests and fill in test=offline_app.update_algorithm in and click run.
#


#working tests, does not trigger bugs in opera:

#-----------------------------------Special ui event tests----------------------
# These tests use a customized javascript api to catch events
# that should normally have gone to UI.  These events only exists for this 
# selftest-framework.
#
# The events are sent in the form of callbacks:
#
# applicationCache.onDownloadAppCache
# applicationCache.cancelDownloadAppCache // forget about then previously received onDownloadAppCache event
# Reply function: window.onDownloadAppCacheReply(<true or false>)

# applicationCache.onCheckForNewAppCacheVersion
# applicationCache.cancelCheckForNewAppCacheVersion // forget about then previously received onCheckForNewAppCacheVersion event
# Reply function: window.onCheckForNewAppCacheVersionReply(<true or false>)
#
# applicationCache.onDownloadNewAppCacheVersion
# applicationCache.cancelDownloadNewAppCacheVersion // forget about then previously received onDownloadNewAppCacheVersion event
# reply function: window.onDownloadNewAppCacheVersionReply(<true or false>)

# applicationCache.onIncreaseAppCacheQuota
# applicationCache.cancelIncreaseAppCacheQuota  // forget about then previously received onIncreaseAppCacheQuota event
# onQuotaReply(<true or false>) 
#
#
# Cancelable UI events. These are application cache events that first is sent 
# to ecmascript. Here we catch the event that are sent to the opera UI.
#
# applicationCache.onAppCacheCheckingUI
# onAppCacheCheckingUI
# onAppCacheErrorUI
# onAppCacheNoUpdateUI
# onAppCacheDownloadingUI
# onAppCacheProgressUI
# onAppCacheUpdateReadyUI
# onAppCacheCachedUI
# onAppCacheObsoleteUI

 uitests/simple_ui_test_check_cancel_events.html
 uitests/simple_ui_test_accept_install.html
 uitests/simple_ui_test_deny_install.html
 uitests/simple_ui_test_deny_checking_update.html
 uitests/simple_ui_test_accept_checking_update.html
 uitests/simple_ui_test_deny_updating.html

#-----------------------------------Normal tests:------------------------------
 opera/paths-currentdirectoryrefs.htm,1
 opera/paths-baseelement.htm,1 
 opera/paths-absurlrefs1.htm,1
 opera/paths-absurlrefs2.htm,1
 opera/paths-absurlrefs3.htm,1
 opera/basicfunctionality1.htm,5  # Extreme test: see if outcome always same. 

 test-simple.html,1
 test-remove-cache.html,2
 404-manifest.html,0
 changing_manifest_during_update.html,1
 offline_test.html,1
 update-withmanifest-withchange.htm,1
 honor_cache_semantics_test_etags.html
 honor_cache_semantics_test_date.html
 swap_cache.html,1

 opera/update-invalid-state-err.htm,0
 opera/swapcache-invalid-state-err.htm,0
 opera/swapcache-invalid-state-err2.htm,1
 opera/update-withmanifest-nochange.htm,1
 opera/update-withmanifest-withchange-checkcontent.htm,0
 opera/swapcache-withmanifest-withchange-checkcontent.htm,0

 opera/manifest-loading-events-error-manifest40x.htm,1
 opera/manifest-loading-events-cached-noupdate.htm,1
 opera/manifest-loading-events-error-resource40x.htm,1
 opera/dynamically-added-manifest.htm,1

 webkit/404-manifest.html,0
 webkit/404-resource.html,0
 webkit/different-scheme.html,1
 webkit/disabled.html,0
 webkit/manifest-containing-itself.html,1

 webkit/wrong-signature.html,0
 webkit/wrong-signature-2.html,0
 webkit/manifest-with-empty-file.html,1
 webkit/manifest-redirect.html,1
 webkit/manifest-redirect-2.html,1
 webkit/wrong-content-type.html,0
 webkit/resource-redirect.html,1
 webkit/resource-redirect-2.html,1
 opera/filetypes-img.htm,1
 opera/filetypes-css.htm,1
 opera/filetypes-script.htm,1
 opera/filetypes-iframe.htm,1
 opera/manifest-loading-events-obsolete.htm,1


 webkit/valid-but-empty-manifest.html,1
 webkit/different-origin-manifest.html,1
 opera/fallback1.htm,1
 opera/fallback2.htm,1
 opera/fallback3.htm,1

 opera/encoding-manifestisutf8.htm,1
 opera/encoding-manifestisutf16.htm,1
# opera/manifest-points-to-source-document.htm,1 


## The problem with this test is that the manifest changes for all loads. That means that the update algorithm will be restarted forever.
### #this test is not implemented properly: #opera/manifest-loading-events-error-manifest-changes-during-update.htm,1 
 
 opera/manifest-events-updateready.htm,1
 opera/manifest-reference-with-hash.htm,1
 webkit/manifest-parsing.html,1
 opera/xhtml1.html,1
 opera/xhtml2.xhtml,1
 opera/xhtml3.xml,1

 opera/onlinewhitelist1.htm,1
 opera/onlinewhitelist2.htm,1
 opera/onlinewhitelist3.htm,1 
 opera/eventhandlers-cached-noupdate.htm,1
 opera/eventhandlers-updateready.htm,1
 opera/eventhandlers-obsolete.htm,1
 opera/eventhandlers-error-resource40x.htm,1
 opera/eventhandlers-error-manifest40x.htm,1
 
 ## The problem with this test is that the manifest changes for all loads. That means that the update algorithm will be restarted forever.
# ### this test is not implemented propely #opera/eventhandlers-error-manifest-changes-during-update.htm,1

#Doesn't work
#test-owa-01.html,0
#implicit-update-01.html,1

# opera/encoding-cyrillicmanifest1.htm,1
# opera/encoding-cyrillicmanifest1.htm,1
# opera/encoding-manifest-explicitentryiscyrillic1.htm,1
# opera/encoding-manifest-explicitentryiscyrillic2.htm,1
# opera/encoding-manifest-explicitentryiscyrillic3.htm,1
# opera/encoding-manifest-explicitentryiscyrillic4.htm,1
# opera/encoding-manifestiskoi8r.htm,1
