diff --git a/websockets/protocol.py b/websockets/protocol.py
index <HASH>..<HASH> 100644
--- a/websockets/protocol.py
+++ b/websockets/protocol.py
@@ -379,7 +379,7 @@ class WebSocketCommonProtocol(asyncio.StreamReaderProtocol):
         # longer than the worst case (2 * self.timeout) but not unlimited.
         if self.state == CLOSING:
             yield from asyncio.wait_for(
-                self.connection_closed, 3 * self.timeout, loop=self.loop)
+                self.worker, 3 * self.timeout, loop=self.loop)
             raise ConnectionClosed(self.close_code, self.close_reason)
 
         # Control may only reach this point in buggy third-party subclasses.
Prevent unintended timeout.

The library considers that its job is done when the worker task exits.

Usually connection_closed will have been set by connection_lost, but
this is somewhat outside of our control, making it preferrable to test
consistently for the worker's termination.