bluetooth: Improve NOT_ALLOWED_TO_ACCESS_SERVICE error message

Review-Url: https://codereview.chromium.org/2048933005
Cr-Commit-Position: refs/heads/master@{#399984}
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-absent-service.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-absent-service.html
index a7fd196..9d95acd 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-absent-service.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-absent-service.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-present-service.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-present-service.html
index 26b6fdd..f956677 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-present-service.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/delayed-discovery-no-permission-present-service.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-absent-service.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-absent-service.html
index 7eb214e..f7e562f 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-absent-service.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-absent-service.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('HeartRateAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-present-service.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-present-service.html
index eef2c1b..167638b 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-present-service.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/no-permission-present-service.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('HeartRateAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html
index 6b944e4..8fdad59 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/blacklisted-services-with-uuid.html
@@ -12,9 +12,10 @@
     .then(device => device.gatt.connect())
     .then(gattServer => assert_promise_rejects_with_message(
       gattServer.getPrimaryServices('human_interface_device'),
+
       new DOMException('Origin is not allowed to access the service. ' +
-                       'Remember to add the service to a filter or to ' +
-                       'optionalServices in requestDevice().',
+                       'Tip: Add the service UUID to \'optionalServices\' ' +
+                       'in requestDevice() options. https://goo.gl/HxfxSQ',
       'SecurityError')));
 }, 'Request for services. Does not return blacklisted service.');
 </script>
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-absent-service-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-absent-service-with-uuid.html
index 93ca203..3042ebb 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-absent-service-with-uuid.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-absent-service-with-uuid.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service-with-uuid.html
index 4b157a8..f431c49 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service-with-uuid.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service-with-uuid.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html
index 38930ba..9ee61b52 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-absent-service-with-uuid.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('HeartRateAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html
index 9a0d8a1..b739f83 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/no-permission-present-service-with-uuid.html
@@ -6,9 +6,9 @@
 'use strict';
 promise_test(() => {
   let expected = new DOMException('Origin is not allowed to access the ' +
-                                  'service. Remember to add the service to a ' +
-                                  'filter or to optionalServices in ' +
-                                  'requestDevice().',
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
                                   'SecurityError');
   return setBluetoothFakeAdapter('HeartRateAdapter')
     .then(() => requestDeviceWithKeyDown({
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html
index fa814db..18f7efd 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/blacklisted-service-in-optionalServices.html
@@ -5,10 +5,11 @@
 <script>
 'use strict';
 promise_test(() => {
-  let expected = new DOMException(
-    'Origin is not allowed to access the service. Remember to add the ' +
-    'service to a filter or to optionalServices in requestDevice().',
-    'SecurityError');
+  let expected = new DOMException('Origin is not allowed to access the ' +
+                                  'service. Tip: Add the service UUID to ' +
+                                  '\'optionalServices\' in requestDevice() ' +
+                                  'options. https://goo.gl/HxfxSQ',
+                                  'SecurityError');
   return setBluetoothFakeAdapter('BlacklistTestAdapter')
     .then(() => requestDeviceWithKeyDown({
       filters: [{services: [blacklist_test_service_uuid]}],
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp
index cc25d0ab..07f3731 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothError.cpp
@@ -71,7 +71,7 @@
         MAP_ERROR(BLACKLISTED_CHARACTERISTIC_UUID, SecurityError, "getCharacteristic(s) called with blacklisted UUID. https://goo.gl/4NeimX");
         MAP_ERROR(BLACKLISTED_READ, SecurityError, "readValue() called on blacklisted object marked exclude-reads. https://goo.gl/4NeimX");
         MAP_ERROR(BLACKLISTED_WRITE, SecurityError, "writeValue() called on blacklisted object marked exclude-writes. https://goo.gl/4NeimX");
-        MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, "Origin is not allowed to access the service. Remember to add the service to a filter or to optionalServices in requestDevice().");
+        MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, "Origin is not allowed to access the service. Tip: Add the service UUID to 'optionalServices' in requestDevice() options. https://goo.gl/HxfxSQ");
         MAP_ERROR(REQUEST_DEVICE_WITH_BLACKLISTED_UUID, SecurityError, "requestDevice() called with a filter containing a blacklisted UUID. https://goo.gl/4NeimX");
         MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError, "requestDevice() called from cross-origin iframe.");
         MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError, "No window to show the requestDevice() dialog.");